Skip to content

Commit 4bac3ac

Browse files
committed
Option to hide menu (win/linux)
1 parent 1d2b53f commit 4bac3ac

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const { setApplicationMenu } = require("./menu");
99
const {
1010
autoUpdate,
1111
getEnabledPlugins,
12+
hideMenu,
1213
isAppVisible,
1314
isTrayEnabled,
1415
store,
@@ -85,6 +86,7 @@ function createMainWindow() {
8586
},
8687
frame: !is.macOS(),
8788
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
89+
autoHideMenuBar: hideMenu(),
8890
});
8991
if (windowMaximized) {
9092
win.maximize();

menu.js

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {
77
enablePlugin,
88
disablePlugin,
99
autoUpdate,
10+
hideMenu,
1011
isAppVisible,
1112
isTrayEnabled,
1213
setOptions,
@@ -42,6 +43,18 @@ const mainMenuTemplate = (win) => [
4243
setOptions({ autoUpdates: item.checked });
4344
},
4445
},
46+
...(is.windows() || is.linux()
47+
? [
48+
{
49+
label: "Hide menu",
50+
type: "checkbox",
51+
checked: hideMenu(),
52+
click: (item) => {
53+
setOptions({ hideMenu: item.checked });
54+
},
55+
},
56+
]
57+
: []),
4558
...(is.windows() || is.macOS()
4659
? // Only works on Win/Mac
4760
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows

store/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const store = new Store({
1313
tray: false,
1414
appVisible: true,
1515
autoUpdates: true,
16+
hideMenu: false,
1617
startAtLogin: false,
1718
},
1819
},
@@ -31,5 +32,6 @@ module.exports = {
3132
isTrayEnabled: () => store.get("options.tray"),
3233
isAppVisible: () => store.get("options.appVisible"),
3334
autoUpdate: () => store.get("options.autoUpdates"),
35+
hideMenu: () => store.get("options.hideMenu"),
3436
startAtLogin: () => store.get("options.startAtLogin"),
3537
};

0 commit comments

Comments
 (0)