Fixed full-screen issue
This commit is contained in:
parent
c9d2143f34
commit
171d6c563a
@ -5,8 +5,6 @@ const shell = require('electron').shell
|
||||
|
||||
let is_shown = true;
|
||||
|
||||
app.win = null;
|
||||
|
||||
app.on('ready', () =>
|
||||
{
|
||||
app.win = new BrowserWindow({
|
||||
@ -52,8 +50,6 @@ app.on('ready', () =>
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
app.inspect = function()
|
||||
{
|
||||
app.win.toggleDevTools();
|
||||
@ -66,12 +62,20 @@ app.toggle_fullscreen = function()
|
||||
|
||||
app.toggle_visible = function()
|
||||
{
|
||||
if(is_shown){ app.win.hide(); } else{ app.win.show(); }
|
||||
if(process.platform == "win32"){
|
||||
if(!app.win.isMinimized()){ app.win.minimize(); } else{ app.win.restore(); }
|
||||
}
|
||||
else{
|
||||
if(is_shown && !app.win.isFullScreen()){ app.win.hide(); } else{ app.win.show(); }
|
||||
}
|
||||
}
|
||||
|
||||
app.inject_menu = function(m)
|
||||
app.inject_menu = function(menu)
|
||||
{
|
||||
if(process.platform == "win32"){ return; }
|
||||
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(m));
|
||||
try{
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
|
||||
}
|
||||
catch(err){
|
||||
console.warn("Cannot inject menu.")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user