mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
some work on splashscreen mechanics...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a3f5579faa
commit
86f75e1b68
@ -66,6 +66,10 @@ function createWindow() {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
|
||||
@ -120,6 +120,10 @@ var NWHostActions = actions.Actions({
|
||||
|
||||
nw.Shell.showItemInFolder(path)
|
||||
}],
|
||||
|
||||
toggleSplashScreen: ['Interface/',
|
||||
function(){
|
||||
}],
|
||||
})
|
||||
|
||||
var NWHost =
|
||||
@ -226,6 +230,41 @@ var ElectronHostActions = actions.Actions({
|
||||
.exec('explorer.exe /select,'+JSON.stringify(path.replace(/\//g, '\\')))
|
||||
//.exec('open -R '+JSON.stringify(path))
|
||||
}],
|
||||
|
||||
// XXX make this a real toggler...
|
||||
toggleSplashScreen: ['Interface/',
|
||||
function(){
|
||||
var splash = this.splash = new electron.BrowserWindow({
|
||||
// let the window to get ready before we show it to the user...
|
||||
//show: false,
|
||||
|
||||
frame: false,
|
||||
center: true,
|
||||
//backgroundColor: XXX,
|
||||
width: 500,
|
||||
height: 500,
|
||||
|
||||
alwaysOnTop: true,
|
||||
|
||||
resizable: false,
|
||||
movable: false,
|
||||
minimizable: false,
|
||||
maximizable: false,
|
||||
fullscreenable: false,
|
||||
|
||||
autoHideMenuBar: true,
|
||||
})
|
||||
|
||||
splash.setMenu(null)
|
||||
|
||||
// and load the index.html of the app.
|
||||
splash.loadURL(url.format({
|
||||
// XXX unify this with index.html
|
||||
pathname: path.join(__dirname, 'splash.html'),
|
||||
protocol: 'file:',
|
||||
slashes: true
|
||||
}))
|
||||
}],
|
||||
})
|
||||
|
||||
var ElectronHost =
|
||||
@ -252,6 +291,8 @@ var AppControlActions = actions.Actions({
|
||||
'window-title': '${FILENAME} - ImageGrid.Viewer (${VERSION})',
|
||||
|
||||
'window-delay-initial-display': 200,
|
||||
|
||||
'show-splash-screen': 'on',
|
||||
},
|
||||
|
||||
// XXX revise these...
|
||||
@ -346,6 +387,9 @@ var AppControlActions = actions.Actions({
|
||||
|
||||
}, this.config['window-delay-initial-display'] || 0)
|
||||
}],
|
||||
|
||||
toggleSplashScreenShowing: ['Interface/Splash screen on start',
|
||||
core.makeConfigToggler('show-splash-screen', ['on', 'off'])],
|
||||
})
|
||||
|
||||
// XXX store/load window state...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user