From cbb4a83977d308f75aebf205e9c3402d9bc893fe Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Wed, 29 May 2024 21:09:31 +0200 Subject: [PATCH 1/2] Fix icons --- lib/Utils.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Utils.vala b/lib/Utils.vala index bb4684447..20e5c3891 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -31,6 +31,8 @@ namespace Gala { private static AppCache app_cache; + private static Gtk.IconTheme icon_theme = new Gtk.IconTheme (); + static construct { icon_cache = new Gee.HashMultiMap (); window_to_desktop_cache = new Gee.HashMap (); @@ -155,7 +157,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 +226,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; From 2d00442127cbbac5b2c9d389a7351d1c8523d794 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Thu, 30 May 2024 00:51:54 +0200 Subject: [PATCH 2/2] Update lib/Utils.vala MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Danielle Foré --- lib/Utils.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Utils.vala b/lib/Utils.vala index 20e5c3891..ab0b71e1a 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -31,9 +31,11 @@ namespace Gala { private static AppCache app_cache; - private static Gtk.IconTheme icon_theme = new Gtk.IconTheme (); + 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 ();