tweak menu behavior on non-Mac

This commit is contained in:
Damillora 2017-07-07 14:53:35 +07:00
parent 718bae29ab
commit 73608d17e1
3 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,9 @@ function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
setdock.setdock(win)
Menu.setApplicationMenu(themenu(win));
if(process.platform == 'darwin') { Menu.setApplicationMenu(themenu(win)); }
else { win.setMenu(themenu(win));
}
// and load the index.html of the app.
win.loadURL('http://pf.gree.net/58737',options);
// Open the DevTools.

View File

@ -113,6 +113,8 @@ module.exports = function(win){
label: "File",
submenu: [
{label: 'Preferences',click(){prefman.showPreferences()}},
{type: 'separator'},
{label: 'Exit', click(){ app.quit() }},
],
visible: process.platform !== 'darwin'
})

View File

@ -10,6 +10,7 @@ require('electron-debug')();
function showPreferences_int(){
if(!preferencesWindow){
preferencesWindow = new BrowserWindow({width: 800, height: 600})
if (process.platform !== 'darwin') preferencesWindow.setMenu(null);
preferencesWindow.loadURL(url.format({
pathname: path.join(__dirname, 'preferences.html'),
protocol: 'file:',