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.
|
// Create the browser window.
|
||||||
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
|
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
|
||||||
setdock.setdock(win)
|
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.
|
// and load the index.html of the app.
|
||||||
win.loadURL('http://pf.gree.net/58737',options);
|
win.loadURL('http://pf.gree.net/58737',options);
|
||||||
// Open the DevTools.
|
// Open the DevTools.
|
||||||
|
2
menu.js
2
menu.js
@ -113,6 +113,8 @@ module.exports = function(win){
|
|||||||
label: "File",
|
label: "File",
|
||||||
submenu: [
|
submenu: [
|
||||||
{label: 'Preferences',click(){prefman.showPreferences()}},
|
{label: 'Preferences',click(){prefman.showPreferences()}},
|
||||||
|
{type: 'separator'},
|
||||||
|
{label: 'Exit', click(){ app.quit() }},
|
||||||
],
|
],
|
||||||
visible: process.platform !== 'darwin'
|
visible: process.platform !== 'darwin'
|
||||||
})
|
})
|
||||||
|
@ -10,6 +10,7 @@ require('electron-debug')();
|
|||||||
function showPreferences_int(){
|
function showPreferences_int(){
|
||||||
if(!preferencesWindow){
|
if(!preferencesWindow){
|
||||||
preferencesWindow = new BrowserWindow({width: 800, height: 600})
|
preferencesWindow = new BrowserWindow({width: 800, height: 600})
|
||||||
|
if (process.platform !== 'darwin') preferencesWindow.setMenu(null);
|
||||||
preferencesWindow.loadURL(url.format({
|
preferencesWindow.loadURL(url.format({
|
||||||
pathname: path.join(__dirname, 'preferences.html'),
|
pathname: path.join(__dirname, 'preferences.html'),
|
||||||
protocol: 'file:',
|
protocol: 'file:',
|
||||||
|
Reference in New Issue
Block a user