restore original menu lint

This commit is contained in:
Araxeus
2021-04-30 04:33:23 +03:00
parent 54cbe3faa4
commit d0d4ada7c2

165
menu.js
View File

@ -104,38 +104,30 @@ const mainMenuTemplate = (win, withRoles = true, isTray = false) => [
}, },
...(is.windows() || is.linux() ...(is.windows() || is.linux()
? [ ? [
{ {
label: "Hide menu", label: "Hide menu",
type: "checkbox", type: "checkbox",
checked: config.get("options.hideMenu"), checked: config.get("options.hideMenu"),
click: (item) => { click: (item) => {
config.set("options.hideMenu", item.checked); config.set("options.hideMenu", item.checked);
},
}, },
}, ]
]
: []), : []),
...(is.windows() || is.macOS() ...(is.windows() || is.macOS()
? // Only works on Win/Mac ? // Only works on Win/Mac
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows // https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows
[ [
{ {
label: "Start at login", label: "Start at login",
type: "checkbox", type: "checkbox",
checked: config.get("options.startAtLogin"), checked: config.get("options.startAtLogin"),
click: (item) => { click: (item) => {
config.set("options.startAtLogin", item.checked); config.set("options.startAtLogin", item.checked);
},
}, },
}, ]
]
: []), : []),
{
label: "Proxy",
type: "checkbox",
checked: !!config.get("options.proxy"),
click: (item) => {
setProxy(item, win);
}
},
{ {
label: "Tray", label: "Tray",
submenu: [ submenu: [
@ -180,6 +172,15 @@ const mainMenuTemplate = (win, withRoles = true, isTray = false) => [
], ],
}, },
{ type: "separator" }, { type: "separator" },
// Should be put in Advanced Options submenu
{
label: "Proxy",
type: "checkbox",
checked: !!config.get("options.proxy"),
click: (item) => {
setProxy(item, win);
}
},
{ {
label: "Toggle DevTools", label: "Toggle DevTools",
// Cannot use "toggleDevTools" role in MacOS // Cannot use "toggleDevTools" role in MacOS
@ -203,56 +204,56 @@ const mainMenuTemplate = (win, withRoles = true, isTray = false) => [
}, },
...(!isTray ...(!isTray
? [ ? [
{ {
label: "View", label: "View",
submenu: withRoles submenu: withRoles
? [ ? [
{ role: "reload" }, { role: "reload" },
{ role: "forceReload" }, { role: "forceReload" },
{ type: "separator" }, { type: "separator" },
{ role: "zoomIn" }, { role: "zoomIn" },
{ role: "zoomOut" }, { role: "zoomOut" },
{ role: "resetZoom" }, { role: "resetZoom" },
] ]
: [ : [
{ {
label: "Reload", label: "Reload",
click: () => { click: () => {
win.webContents.reload(); win.webContents.reload();
}, },
}, },
{ {
label: "Force Reload", label: "Force Reload",
click: () => { click: () => {
win.webContents.reloadIgnoringCache(); win.webContents.reloadIgnoringCache();
}, },
}, },
{ type: "separator" }, { type: "separator" },
{ {
label: "Zoom In", label: "Zoom In",
click: () => { click: () => {
win.webContents.setZoomLevel( win.webContents.setZoomLevel(
win.webContents.getZoomLevel() + 1 win.webContents.getZoomLevel() + 1
); );
}, },
}, },
{ {
label: "Zoom Out", label: "Zoom Out",
click: () => { click: () => {
win.webContents.setZoomLevel( win.webContents.setZoomLevel(
win.webContents.getZoomLevel() - 1 win.webContents.getZoomLevel() - 1
); );
}, },
}, },
{ {
label: "Reset Zoom", label: "Reset Zoom",
click: () => { click: () => {
win.webContents.setZoomLevel(0); win.webContents.setZoomLevel(0);
}, },
}, },
], ],
}, },
] ]
: []), : []),
{ {
label: "Navigation", label: "Navigation",
@ -282,13 +283,13 @@ const mainMenuTemplate = (win, withRoles = true, isTray = false) => [
}, },
...(!isTray ...(!isTray
? [ ? [
{ {
label: "Quit App", label: "Quit App",
click: () => { click: () => {
app.quit(); app.quit();
},
}, },
}, ]
]
: []), : []),
], ],
}, },