[gnome-music/wip/jfelder/gtk4-v3: 70/115] coverpaintable: Fix defaulticon look
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/gtk4-v3: 70/115] coverpaintable: Fix defaulticon look
- Date: Tue, 8 Feb 2022 11:39:03 +0000 (UTC)
commit f7db355a4f9dc45a86939bda5ced8049a1314a77
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]