mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-17 05:02:06 +00:00
Rename cssFiles option to themes and add menu entry
This commit is contained in:
6
index.js
6
index.js
@ -85,9 +85,9 @@ function onClosed() {
|
|||||||
function loadPlugins(win) {
|
function loadPlugins(win) {
|
||||||
injectCSS(win.webContents, path.join(__dirname, "youtube-music.css"));
|
injectCSS(win.webContents, path.join(__dirname, "youtube-music.css"));
|
||||||
// Load user CSS
|
// Load user CSS
|
||||||
const cssFiles = config.get("options.cssFiles");
|
const themes = config.get("options.themes");
|
||||||
if (Array.isArray(cssFiles)) {
|
if (Array.isArray(themes)) {
|
||||||
cssFiles.forEach((cssFile) => {
|
themes.forEach((cssFile) => {
|
||||||
fileExists(
|
fileExists(
|
||||||
cssFile,
|
cssFile,
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
28
menu.js
28
menu.js
@ -100,6 +100,34 @@ const mainMenuTemplate = (win) => {
|
|||||||
config.set("options.ForceShowLikeButtons", item.checked);
|
config.set("options.ForceShowLikeButtons", item.checked);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Theme",
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: "No theme",
|
||||||
|
type: "radio",
|
||||||
|
checked: !config.get("options.themes"), // todo rename "themes"
|
||||||
|
click: () => {
|
||||||
|
config.set("options.themes", []);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ type: "separator" },
|
||||||
|
{
|
||||||
|
label: "Import custom CSS file",
|
||||||
|
type: "radio",
|
||||||
|
checked: false,
|
||||||
|
click: async () => {
|
||||||
|
const { filePaths } = await dialog.showOpenDialog({
|
||||||
|
filters: [{ name: "CSS Files", extensions: ["css"] }],
|
||||||
|
properties: ["openFile", "multiSelections"],
|
||||||
|
});
|
||||||
|
if (filePaths) {
|
||||||
|
config.set("options.themes", filePaths);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,6 +97,12 @@ If you get an error "is damaged and can’t be opened." when launching the app,
|
|||||||
|
|
||||||
> If using `Hide Menu` option - you can show the menu with the `alt` key (or `escape` if using the in-app-menu plugin)
|
> If using `Hide Menu` option - you can show the menu with the `alt` key (or `escape` if using the in-app-menu plugin)
|
||||||
|
|
||||||
|
## Themes
|
||||||
|
|
||||||
|
You can load CSS files to change the look of the application (Options > Visual Tweaks > Themes).
|
||||||
|
|
||||||
|
Some predefined themes are available in https://github.com/OceanicSquirrel/themes-for-ytmdesktop-player.
|
||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
Reference in New Issue
Block a user