dock: show client progress

This commit is contained in:
Feross Aboukhadijeh
2016-03-03 13:52:32 -08:00
parent f0bd05917b
commit aed424d0bc
2 changed files with 25 additions and 6 deletions

View File

@@ -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)