[shotwell/shotwell-0.30] Fix generic plugin icon fall-back
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/shotwell-0.30] Fix generic plugin icon fall-back
- Date: Fri, 28 Sep 2018 07:12:00 +0000 (UTC)
commit 271f377c589aed77e5e38d2fb1e915b257c47621
Author: Jens Georg <mail jensge org>
Date: Mon Sep 10 22:53:11 2018 +0200
Fix generic plugin icon fall-back
src/Resources.vala | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/Resources.vala b/src/Resources.vala
index e401376b..8fabbe41 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -1008,7 +1008,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
// fetch from cache and if not present, from disk
Gdk.Pixbuf? pixbuf = icon_cache.get(name);
if (pixbuf == null) {
- pixbuf = load_icon(name, 0);
+ pixbuf = load_icon(name, scale);
if (pixbuf == null)
return null;
@@ -1030,6 +1030,14 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
public Gdk.Pixbuf? load_icon(string name, int scale = DEFAULT_ICON_SCALE) {
Gdk.Pixbuf pixbuf = null;
+ try {
+ var theme = Gtk.IconTheme.get_default();
+ var info = theme.lookup_icon(name, scale, Gtk.IconLookupFlags.GENERIC_FALLBACK);
+ pixbuf = info.load_symbolic_for_context(AppWindow.get_instance().get_style_context(), null);
+ } catch (Error err) {
+ debug("Failed to find icon %s in theme, falling back to resources", name);
+ }
+
try {
var path = "/org/gnome/Shotwell/icons/%s".printf(name);
pixbuf = new Gdk.Pixbuf.from_resource(path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]