main: create a simple config window to set CLI arguments when executed without argument
This commit is contained in:
parent
94fa41ca3a
commit
59326dff48
7 changed files with 325 additions and 14 deletions
40
app/main/electron-window.js
Normal file
40
app/main/electron-window.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
var path = require('path'),
|
||||
{BrowserWindow} = require('electron'),
|
||||
shortcut = require('electron-localshortcut'),
|
||||
settings = require('./settings')
|
||||
|
||||
module.exports = function(options={}) {
|
||||
|
||||
var window
|
||||
|
||||
window = new BrowserWindow({
|
||||
width: options.width || 800,
|
||||
height: options.height || 600,
|
||||
title: options.title || settings.read('appName'),
|
||||
backgroundColor:'#1a1d22',
|
||||
type:options.type
|
||||
})
|
||||
|
||||
window.loadURL(options.address)
|
||||
|
||||
window.on('closed', function() {
|
||||
window = null
|
||||
})
|
||||
|
||||
window.setMenuBarVisibility(false)
|
||||
|
||||
shortcut.register(window,'CmdOrCtrl+R',function(){
|
||||
window.reload()
|
||||
})
|
||||
|
||||
shortcut.register(window,'F11',function(){
|
||||
window.setFullScreen(!window.isFullScreen())
|
||||
})
|
||||
|
||||
shortcut.register(window,'F12',function(){
|
||||
window.toggleDevTools();
|
||||
})
|
||||
|
||||
return window
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue