Remove Gtk.IconTheme use as St.IconTheme is preferred (but TBD for now)

This commit is contained in:
Neil Bird 2023-07-17 16:49:39 +01:00
parent fae82334a6
commit 1eecb66c15
2 changed files with 2 additions and 17 deletions

View file

@ -85,16 +85,6 @@ class PiHole extends panelMenu.Button
// Create a Soup session with which to do requests // Create a Soup session with which to do requests
this.SoupSession = new Soup.Session(); this.SoupSession = new Soup.Session();
// Access icon theme and keep it up to date
const stsettings = St.Settings.get();
this.IconTheme = new Gtk.IconTheme();
this.IconTheme.set_theme_name( stsettings.gtk_icon_theme );
let this_ = this;
stsettings.connect( 'notify::gtk-icon-theme', (settings_,key_) => {
this_.IconTheme.set_theme_name( settings_.gtk_icon_theme );
this_.setIcon();
});
// Create button/icon // Create button/icon
this.Icon = new St.Icon({ style_class: 'system-status-icon' }); this.Icon = new St.Icon({ style_class: 'system-status-icon' });
this.add_child( this.Icon ); this.add_child( this.Icon );
@ -208,12 +198,7 @@ class PiHole extends panelMenu.Button
// Get custom icon from theme or file // Get custom icon from theme or file
getCustomIcon(icon_name) getCustomIcon(icon_name)
{ {
// Themed? // TBD deal with icon themes via St.IconTheme
if (this.IconTheme.has_icon(icon_name))
{
this.dprint("setting new icon " + icon_name + " from theme");
return Gio.ThemedIcon({name: icon_name});
}
// Falback to included icons // Falback to included icons
let icon_path = PiHoleExtMetadata.dir.get_child('icons').get_child( icon_name + ".svg" ).get_path(); let icon_path = PiHoleExtMetadata.dir.get_child('icons').get_child( icon_name + ".svg" ).get_path();

View file

@ -6,5 +6,5 @@
"description": "Status and basic controls of local Pi-Hole", "description": "Status and basic controls of local Pi-Hole",
"settings-schema": "org.gnome.shell.extensions.fnxweb-pi-hole", "settings-schema": "org.gnome.shell.extensions.fnxweb-pi-hole",
"gettext-domain": "gnome-shell-extension-fnxweb-pi-hole", "gettext-domain": "gnome-shell-extension-fnxweb-pi-hole",
"version": 7 "version": 8
} }