Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix icons #1936

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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<DesktopAppInfo, CachedIcon?> ();
window_to_desktop_cache = new Gee.HashMap<Meta.Window, DesktopAppInfo> ();
unknown_icon_cache = new Gee.ArrayList<CachedIcon?> ();
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
Loading