File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed
Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,9 @@ function onClosed() {
8585function loadPlugins ( win ) {
8686 injectCSS ( win . webContents , path . join ( __dirname , "youtube-music.css" ) ) ;
8787 // Load user CSS
88- const cssFiles = config . get ( "options.cssFiles " ) ;
89- if ( Array . isArray ( cssFiles ) ) {
90- cssFiles . forEach ( ( cssFile ) => {
88+ const themes = config . get ( "options.themes " ) ;
89+ if ( Array . isArray ( themes ) ) {
90+ themes . forEach ( ( cssFile ) => {
9191 fileExists (
9292 cssFile ,
9393 ( ) => {
Original file line number Diff line number Diff line change @@ -100,6 +100,34 @@ const mainMenuTemplate = (win) => {
100100 config . set ( "options.ForceShowLikeButtons" , item . checked ) ;
101101 } ,
102102 } ,
103+ {
104+ label : "Theme" ,
105+ submenu : [
106+ {
107+ label : "No theme" ,
108+ type : "radio" ,
109+ checked : ! config . get ( "options.themes" ) , // todo rename "themes"
110+ click : ( ) => {
111+ config . set ( "options.themes" , [ ] ) ;
112+ } ,
113+ } ,
114+ { type : "separator" } ,
115+ {
116+ label : "Import custom CSS file" ,
117+ type : "radio" ,
118+ checked : false ,
119+ click : async ( ) => {
120+ const { filePaths } = await dialog . showOpenDialog ( {
121+ filters : [ { name : "CSS Files" , extensions : [ "css" ] } ] ,
122+ properties : [ "openFile" , "multiSelections" ] ,
123+ } ) ;
124+ if ( filePaths ) {
125+ config . set ( "options.themes" , filePaths ) ;
126+ }
127+ } ,
128+ } ,
129+ ] ,
130+ } ,
103131 ] ,
104132 } ,
105133 {
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ If you get an error "is damaged and can’t be opened." when launching the app,
9797
9898> If using ` Hide Menu ` option - you can show the menu with the ` alt ` key (or ` escape ` if using the in-app-menu plugin)
9999
100+ ## Themes
101+
102+ You can load CSS files to change the look of the application (Options > Visual Tweaks > Themes).
103+
104+ Some predefined themes are available in https://github.com/OceanicSquirrel/themes-for-ytmdesktop-player .
105+
100106## Dev
101107
102108``` sh
You can’t perform that action at this time.
0 commit comments