[gnome-music/wip/mschraal/gtk4-v3: 3/4] coverpaintable: Fix defaulticon look
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gtk4-v3: 3/4] coverpaintable: Fix defaulticon look
- Date: Thu, 3 Feb 2022 17:21:02 +0000 (UTC)
commit 03f28b2c450d6a43085099b1ec6dc5651340acf4
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]