diff --git a/css/styles.css b/css/styles.css index b6c403e0..f6565d07 100644 --- a/css/styles.css +++ b/css/styles.css @@ -88,10 +88,10 @@ radio { .tvmode .playercontrols { -gtk-icon-size: 24px; } -.playbackicon { +.adwicons .playbackicon { -gtk-icon-size: 20px; } -.tvmode .playbackicon { +.adwicons.tvmode .playbackicon { -gtk-icon-size: 28px; } .labelbutton { diff --git a/src/appBase.js b/src/appBase.js index 3faeffce..09b7783b 100644 --- a/src/appBase.js +++ b/src/appBase.js @@ -74,7 +74,9 @@ class ClapperAppBase extends Gtk.Application Gio.SettingsBindFlags.GET ); this._onThemeChanged(gtkSettings); + this._onIconThemeChanged(gtkSettings); gtkSettings.connect('notify::gtk-theme-name', this._onThemeChanged.bind(this)); + gtkSettings.connect('notify::gtk-icon-theme-name', this._onIconThemeChanged.bind(this)); this.windowShowSignal = this.active_window.connect( 'show', this._onWindowShow.bind(this) @@ -110,4 +112,20 @@ class ClapperAppBase extends Gtk.Application gtkSettings.gtk_theme_name = parsedTheme; debug(`set theme: ${parsedTheme}`); } + + _onIconThemeChanged(gtkSettings) + { + const iconTheme = gtkSettings.gtk_icon_theme_name; + const window = this.active_window; + const hasAdwIcons = window.has_css_class('adwicons'); + + if(iconTheme === 'Adwaita') { + if(!hasAdwIcons) + window.add_css_class('adwicons'); + } + else { + if(hasAdwIcons) + window.remove_css_class('adwicons'); + } + } });