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:
Rafał Dzięgiel
2021-03-24 20:36:08 +01:00
parent 1f18796e0d
commit b404eb2f56
2 changed files with 20 additions and 2 deletions

View File

@@ -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');
}
}
});