[gnome-music/wip/mschraal/fix-artstack-size-setter] artstack: Set default size on stack




commit 8da5c77015e2bf73586348fa4ffadf95eb42e4d1
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun May 16 08:37:27 2021 +0200

    artstack: Set default size on stack
    
    ArtStack currently sets the default size on a GtkImage in a stack page.
    This works in GTK3. However, in GTK4 the hidden page is not used in size
    calculation it seems, which results in incorrect sizing of some images.
    
    Set the requested size on the ArtStack directly instead. Futureproofing
    ArtStack sizing.

 gnomemusic/widgets/artstack.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/widgets/artstack.py b/gnomemusic/widgets/artstack.py
index 129b67a81..772e359db 100644
--- a/gnomemusic/widgets/artstack.py
+++ b/gnomemusic/widgets/artstack.py
@@ -47,7 +47,7 @@ class ArtStack(Gtk.Stack):
 
         self._cache = None
         self._handler_id = None
-        self._size = None
+        self._size = size
         self._thumbnail_id = 0
 
         self._cover_a = Gtk.Image()
@@ -79,7 +79,7 @@ class ArtStack(Gtk.Stack):
 
         :param ArtSize value: The size to use for the cover
         """
-        self._cover_a.set_size_request(value.width, value.height)
+        self.set_size_request(value.width, value.height)
         self._size = value
 
     @GObject.Property(type=object, default=None)


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