[gnome-music/wip/jfelder/gtk4-v3: 159/174] coverpaintable: Load IconTheme classwide




commit 3fdfa62fa2a6ed5fbc5c77907622c52dbf53d57b
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Feb 4 14:15:13 2022 +0100

    coverpaintable: Load IconTheme classwide

 gnomemusic/coverpaintable.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coverpaintable.py b/gnomemusic/coverpaintable.py
index f006654cb..41729b4a9 100644
--- a/gnomemusic/coverpaintable.py
+++ b/gnomemusic/coverpaintable.py
@@ -7,6 +7,8 @@ class CoverPaintable(GObject.GObject, Gdk.Paintable):
 
     __gtype_name__ = "CoverPaintable"
 
+    _icon_theme = Gtk.IconTheme.new()
+
     def __init__(self, art_size, texture=None):
         super().__init__()
 
@@ -25,8 +27,7 @@ class CoverPaintable(GObject.GObject, Gdk.Paintable):
             snapshot.append_texture(self._texture, rect)
         else:
             i_s = 1 / 3  # Icon scale
-            theme = Gtk.IconTheme.new()
-            icon_pt = theme.lookup_icon(
+            icon_pt = self._icon_theme.lookup_icon(
                 "folder-music-symbolic", None, w * i_s, 1, 0, 0)
 
             snapshot.append_color(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]