Merge pull request #67 from th-ch/hide-menu

Option to hide menu
This commit is contained in:
th-ch
2020-11-28 18:45:53 +01:00
committed by GitHub
4 changed files with 18 additions and 1 deletions

View File

@ -9,6 +9,7 @@ const { setApplicationMenu } = require("./menu");
const {
autoUpdate,
getEnabledPlugins,
hideMenu,
isAppVisible,
isTrayEnabled,
setOptions,
@ -86,6 +87,7 @@ function createMainWindow() {
},
frame: !is.macOS(),
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
autoHideMenuBar: hideMenu(),
});
if (windowMaximized) {
win.maximize();

13
menu.js
View File

@ -7,6 +7,7 @@ const {
enablePlugin,
disablePlugin,
autoUpdate,
hideMenu,
isAppVisible,
isTrayEnabled,
setOptions,
@ -42,6 +43,18 @@ const mainMenuTemplate = (win) => [
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()
? // Only works on Win/Mac
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows

View File

@ -1,7 +1,7 @@
{
"name": "youtube-music",
"productName": "YouTube Music",
"version": "1.6.3",
"version": "1.6.4",
"description": "YouTube Music Desktop App - including custom plugins",
"license": "MIT",
"repository": "th-ch/youtube-music",

View File

@ -13,6 +13,7 @@ const store = new Store({
tray: false,
appVisible: true,
autoUpdates: true,
hideMenu: false,
startAtLogin: false,
},
},
@ -31,5 +32,6 @@ module.exports = {
isTrayEnabled: () => store.get("options.tray"),
isAppVisible: () => store.get("options.appVisible"),
autoUpdate: () => store.get("options.autoUpdates"),
hideMenu: () => store.get("options.hideMenu"),
startAtLogin: () => store.get("options.startAtLogin"),
};