[gnome-music/wip/jfelder/gtk4-v3: 136/259] coverpaintable: Fix defaulticon look
- From: Marinus Schraal <mschraal src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-music/wip/jfelder/gtk4-v3: 136/259] coverpaintable: Fix defaulticon look
 
- Date: Thu, 17 Feb 2022 08:41:22 +0000 (UTC)
 
commit 3b9378362127c0d637c2e954ba64ce0b1f22258b
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]