main: create a simple config window to set CLI arguments when executed without argument

This commit is contained in:
jean-emmanuel 2016-11-05 01:25:02 +01:00
parent 94fa41ca3a
commit 59326dff48
7 changed files with 325 additions and 14 deletions

View 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
}