[gnome-music/wip/jfelder/gtk4-v3: 124/169] coverpaintable: Fix defaulticon look




commit df9b1e1f78a81f75ac896a8a6c7ed27bcc7cff3d
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Feb 3 17:02:33 2022 +0100

    coverpaintable: Fix defaulticon look

 gnomemusic/coverpaintable.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coverpaintable.py b/gnomemusic/coverpaintable.py
index 2ee97b30f..b884d0f5b 100644
--- a/gnomemusic/coverpaintable.py
+++ b/gnomemusic/coverpaintable.py
@@ -34,10 +34,17 @@ class CoverPaintable(GObject.GObject, Gdk.Paintable):
             snapshot.append_texture(self._texture, rect)
             snapshot.pop()
         else:
+            snapshot.append_color(
+                Gdk.RGBA(1, 1, 1, 1), Graphene.Rect().init(0, 0, w, h))
+
+            snapshot.translate(
+                Graphene.Point().init((w / 2) - (w / 6), (h / 2) - (h / 6)))
             theme = Gtk.IconTheme.new()
             icon_pt = theme.lookup_icon(
-                "folder-music-symbolic", None, w, 1, 0, 0)
-            icon_pt.snapshot(snapshot, w, h)
+                "folder-music-symbolic", None, w / 3, 1, 0, 0)
+            snapshot.push_opacity(0.7)
+            icon_pt.snapshot(snapshot, w / 3, h / 3)
+            snapshot.pop()
 
     def do_get_flags(self):
         return Gdk.PaintableFlags.SIZE | Gdk.PaintableFlags.CONTENTS


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