tweak menu behavior on non-Mac
This commit is contained in:
parent
718bae29ab
commit
73608d17e1
4
main.js
4
main.js
@ -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.
|
||||
|
2
menu.js
2
menu.js
@ -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'
|
||||
})
|
||||
|
@ -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:',
|
||||
|
Reference in New Issue
Block a user