[gnome-music/wip/jfelder/open-audio-files: 7/8] window: Set the stack transition once it is populated




commit 3221d9eccaf561a5260e56fcfe45e1ef56310a10
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Jan 7 15:52:05 2022 +0100

    window: Set the stack transition once it is populated
    
    The FilesView is always selected at launch because it is the first
    view added to the stack. However, the next commit will add support to
    open audio files at launch and the FilesView will be selected instead
    of the AlbumsView. This will result in a transition effect from the
    AlbumsView to the FilesView.
    By setting the stack transition property once the correct view is
    selected, this prevents this transition at launch.

 data/ui/Window.ui    | 2 +-
 gnomemusic/window.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/Window.ui b/data/ui/Window.ui
index 276952595..33ba8c0c6 100644
--- a/data/ui/Window.ui
+++ b/data/ui/Window.ui
@@ -23,7 +23,7 @@
                 <property name="hhomogeneous">False</property>
                 <property name="vhomogeneous">False</property>
                 <property name="transition-duration">100</property>
-                <property name="transition-type">crossfade</property>
+                <property name="transition-type">none</property>
                 <property name="visible">True</property>
               </object>
             </child>
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 1d8005ac9..5bee676a6 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -261,6 +261,7 @@ class Window(Handy.ApplicationWindow):
         # appears as selected by the stack switcher on launch.
         self._stack.props.visible_child = self.views[View.ALBUM]
         self._stack.notify("visible-child")
+        self._stack.props.transition_type = Gtk.StackTransitionType.CROSSFADE
 
         self.views[View.SEARCH].bind_property(
             "search-state", self._search, "state",


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