mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Increase play/pause icon size only on Adwaita theme
Adwaita theme has unusually small media constrols icons, but other popular themes do not. Instead increasing those icons on every theme do it only for Adwaita where problem occurs.
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user