dock: show client progress
This commit is contained in:
18
index.js
18
index.js
@@ -58,6 +58,11 @@ electron.ipcMain.on('setAspectRatio', function (e, aspectRatio, extraSize) {
|
||||
setAspectRatio(aspectRatio, extraSize)
|
||||
})
|
||||
|
||||
|
||||
electron.ipcMain.on('setProgress', function (e, progress) {
|
||||
setProgress(progress)
|
||||
})
|
||||
|
||||
function createMainWindow () {
|
||||
var win = new electron.BrowserWindow({
|
||||
backgroundColor: '#282828',
|
||||
@@ -118,6 +123,13 @@ function setAspectRatio (aspectRatio, extraSize) {
|
||||
}
|
||||
}
|
||||
|
||||
// Show progress bar. Valid range is [0, 1]. Remove when < 0; indeterminate when > 1.
|
||||
function setProgress (progress) {
|
||||
if (mainWindow) {
|
||||
mainWindow.setProgressBar(progress)
|
||||
}
|
||||
}
|
||||
|
||||
function toggleDevTools (win) {
|
||||
debug('toggleDevTools')
|
||||
win = win || electron.BrowserWindow.getFocusedWindow()
|
||||
@@ -334,9 +346,3 @@ if (process.platform === 'darwin') {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// var progress = 0
|
||||
// setInterval(function () {
|
||||
// progress += 0.1
|
||||
// mainWindow.setProgressBar(progress)
|
||||
// }, 1000)
|
||||
|
||||
Reference in New Issue
Block a user