[gnome-music/wip/mschraal/gtk4-pre-squash-backup: 209/254] albumsview: Ensure that album_widget is scrollable




commit 0a206cb1ec764159abfeabfe65fbaf0e852fc37a
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Feb 11 16:55:38 2022 +0100

    albumsview: Ensure that album_widget is scrollable

 data/ui/AlbumsView.ui          | 5 +++++
 gnomemusic/views/albumsview.py | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/AlbumsView.ui b/data/ui/AlbumsView.ui
index b2b8bf88e..efd2b1e4b 100644
--- a/data/ui/AlbumsView.ui
+++ b/data/ui/AlbumsView.ui
@@ -28,6 +28,11 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="hscrollbar_policy">never</property>
+            <child>
+              <object class="GtkViewport">
+                <property name="scroll-to-focus">True</property>
+              </object>
+            </child>
           </object>
         </property>
       </object>
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index c01667b02..6aa73dfbd 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -99,7 +99,8 @@ class AlbumsView(Gtk.Stack):
             "selection-mode", self, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL)
 
-        self._album_scrolled_window.set_child(self._album_widget)
+        viewport = self._album_scrolled_window.get_first_child()
+        viewport.set_child(self._album_widget)
 
         self.connect(
             "notify::search-mode-active", self._on_search_mode_changed)


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