mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
stylecheck
This commit is contained in:
12
index.js
12
index.js
@ -75,7 +75,7 @@ function createMainWindow() {
|
||||
const windowSize = config.get("window-size");
|
||||
const windowMaximized = config.get("window-maximized");
|
||||
const windowPosition = config.get("window-position");
|
||||
|
||||
|
||||
const win = new electron.BrowserWindow({
|
||||
icon: icon,
|
||||
width: windowSize.width,
|
||||
@ -93,13 +93,13 @@ function createMainWindow() {
|
||||
affinity: "main-window", // main window, and addition windows should work in one process
|
||||
...(isTesting()
|
||||
? {
|
||||
// Only necessary when testing with Spectron
|
||||
contextIsolation: false,
|
||||
nodeIntegration: true,
|
||||
}
|
||||
// Only necessary when testing with Spectron
|
||||
contextIsolation: false,
|
||||
nodeIntegration: true,
|
||||
}
|
||||
: undefined),
|
||||
},
|
||||
frame: !is.macOS() && !config.plugins.isEnabled("styled-bars"),
|
||||
frame: !is.macOS() && !config.plugins.isEnabled("styled-bars"),
|
||||
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
|
||||
autoHideMenuBar: config.get("options.hideMenu"),
|
||||
});
|
||||
|
||||
@ -5,24 +5,24 @@ const path = require("path");
|
||||
const is = require("electron-is");
|
||||
const { getAllPlugins } = require("../../plugins/utils");
|
||||
const config = require("../../config");
|
||||
//const { myBar } = require("./front");
|
||||
|
||||
|
||||
|
||||
module.exports = win => {
|
||||
injectCSS(win.webContents, path.join(__dirname, "style.css"));
|
||||
//myBar.updateMenu(Menu.buildFromTemplate(mainMenuTemplate));
|
||||
win.on('ready-to-show', () => {
|
||||
console.log("building new menu");
|
||||
const menu = Menu.buildFromTemplate(mainMenuTemplate(win));
|
||||
Menu.setApplicationMenu(menu);
|
||||
})
|
||||
//css for custom scrollbar + disable drag area(was causing bugs)
|
||||
injectCSS(win.webContents, path.join(__dirname, "style.css"));
|
||||
win.on('ready-to-show', () => {
|
||||
const menu = Menu.buildFromTemplate(mainMenuTemplate(win));
|
||||
Menu.setApplicationMenu(menu);
|
||||
})
|
||||
}
|
||||
|
||||
function checkCheckbox(item) {
|
||||
item.checked = !item.checked
|
||||
function checkCheckbox(item) {
|
||||
item.checked = !item.checked
|
||||
}
|
||||
|
||||
const mainMenuTemplate = (win) => [
|
||||
//create new template because it works abit different (need to manually change checkbox + tray is out of submenu)
|
||||
const mainMenuTemplate = (win) => [
|
||||
{
|
||||
label: "Plugins",
|
||||
submenu: [
|
||||
@ -100,33 +100,33 @@ function checkCheckbox(item) {
|
||||
},
|
||||
...(is.windows() || is.linux()
|
||||
? [
|
||||
{
|
||||
label: "Hide menu",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.hideMenu"),
|
||||
click: (item) => {
|
||||
config.set("options.hideMenu", item.checked);
|
||||
checkCheckbox(item);
|
||||
},
|
||||
{
|
||||
label: "Hide menu",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.hideMenu"),
|
||||
click: (item) => {
|
||||
config.set("options.hideMenu", item.checked);
|
||||
checkCheckbox(item);
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(is.windows() || is.macOS()
|
||||
? // Only works on Win/Mac
|
||||
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows
|
||||
[
|
||||
{
|
||||
label: "Start at login",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.startAtLogin"),
|
||||
click: (item) => {
|
||||
config.set("options.startAtLogin", item.checked);
|
||||
checkCheckbox(item);
|
||||
},
|
||||
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows
|
||||
[
|
||||
{
|
||||
label: "Start at login",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.startAtLogin"),
|
||||
click: (item) => {
|
||||
config.set("options.startAtLogin", item.checked);
|
||||
checkCheckbox(item);
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
|
||||
{ type: "separator" },
|
||||
{
|
||||
label: "Toggle DevTools",
|
||||
|
||||
@ -6,5 +6,5 @@ module.exports = () => {
|
||||
itemBackgroundColor: customTitlebar.Color.fromHex('#121212'), //#020
|
||||
});
|
||||
myBar.updateTitle(' ');
|
||||
document.title ="Youtube Music";
|
||||
document.title = "Youtube Music";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user