From 54afc63d4f07cf1e2634b01b4a69a54d3771753a Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Thu, 30 May 2024 00:53:16 +0200 Subject: [PATCH] Fix icons (#1936) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Danielle Foré --- lib/Utils.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Utils.vala b/lib/Utils.vala index bb4684447..ab0b71e1a 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -31,7 +31,11 @@ namespace Gala { private static AppCache app_cache; + private static Gtk.IconTheme icon_theme; + static construct { + icon_theme = new Gtk.IconTheme (); + icon_theme.set_custom_theme ("elementary"); icon_cache = new Gee.HashMultiMap (); window_to_desktop_cache = new Gee.HashMap (); unknown_icon_cache = new Gee.ArrayList (); @@ -155,7 +159,7 @@ namespace Gala { // Construct a new "application-default-icon" and store it in the cache try { - var icon = Gtk.IconTheme.get_default ().load_icon_for_scale ("application-default-icon", icon_size, scale, 0); + var icon = icon_theme.load_icon_for_scale ("application-default-icon", icon_size, scale, 0); unknown_icon_cache.add (CachedIcon () { icon = icon, icon_size = icon_size, scale = scale }); return icon; } catch (Error e) { @@ -224,7 +228,7 @@ namespace Gala { if (icon is GLib.ThemedIcon) { var icon_names = ((GLib.ThemedIcon)icon).get_names (); - var icon_info = Gtk.IconTheme.get_default ().choose_icon_for_scale (icon_names, icon_size, scale, 0); + var icon_info = icon_theme.choose_icon_for_scale (icon_names, icon_size, scale, 0); if (icon_info == null) { return null;