mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 11:51:47 +00:00
Option to hide menu (win/linux)
This commit is contained in:
2
index.js
2
index.js
@ -9,6 +9,7 @@ const { setApplicationMenu } = require("./menu");
|
|||||||
const {
|
const {
|
||||||
autoUpdate,
|
autoUpdate,
|
||||||
getEnabledPlugins,
|
getEnabledPlugins,
|
||||||
|
hideMenu,
|
||||||
isAppVisible,
|
isAppVisible,
|
||||||
isTrayEnabled,
|
isTrayEnabled,
|
||||||
store,
|
store,
|
||||||
@ -85,6 +86,7 @@ function createMainWindow() {
|
|||||||
},
|
},
|
||||||
frame: !is.macOS(),
|
frame: !is.macOS(),
|
||||||
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
|
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
|
||||||
|
autoHideMenuBar: hideMenu(),
|
||||||
});
|
});
|
||||||
if (windowMaximized) {
|
if (windowMaximized) {
|
||||||
win.maximize();
|
win.maximize();
|
||||||
|
|||||||
13
menu.js
13
menu.js
@ -7,6 +7,7 @@ const {
|
|||||||
enablePlugin,
|
enablePlugin,
|
||||||
disablePlugin,
|
disablePlugin,
|
||||||
autoUpdate,
|
autoUpdate,
|
||||||
|
hideMenu,
|
||||||
isAppVisible,
|
isAppVisible,
|
||||||
isTrayEnabled,
|
isTrayEnabled,
|
||||||
setOptions,
|
setOptions,
|
||||||
@ -42,6 +43,18 @@ const mainMenuTemplate = (win) => [
|
|||||||
setOptions({ autoUpdates: item.checked });
|
setOptions({ autoUpdates: item.checked });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
...(is.windows() || is.linux()
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
label: "Hide menu",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: hideMenu(),
|
||||||
|
click: (item) => {
|
||||||
|
setOptions({ 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
|
||||||
|
|||||||
@ -13,6 +13,7 @@ const store = new Store({
|
|||||||
tray: false,
|
tray: false,
|
||||||
appVisible: true,
|
appVisible: true,
|
||||||
autoUpdates: true,
|
autoUpdates: true,
|
||||||
|
hideMenu: false,
|
||||||
startAtLogin: false,
|
startAtLogin: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -31,5 +32,6 @@ module.exports = {
|
|||||||
isTrayEnabled: () => store.get("options.tray"),
|
isTrayEnabled: () => store.get("options.tray"),
|
||||||
isAppVisible: () => store.get("options.appVisible"),
|
isAppVisible: () => store.get("options.appVisible"),
|
||||||
autoUpdate: () => store.get("options.autoUpdates"),
|
autoUpdate: () => store.get("options.autoUpdates"),
|
||||||
|
hideMenu: () => store.get("options.hideMenu"),
|
||||||
startAtLogin: () => store.get("options.startAtLogin"),
|
startAtLogin: () => store.get("options.startAtLogin"),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user