open-stage-control/app/main/electron-window.js
2016-11-05 15:19:29 +01:00

44 lines
975 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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:'#202329',
type:options.type
})
window.loadURL(options.address)
window.on('closed', function() {
window = null
})
window.setMenuBarVisibility(false)
if (options.shortcuts) {
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
}