[PATCH 1/2] Animate the screen transitions.

David Shea dshea at redhat.com
Thu Jan 8 19:59:19 UTC 2015


This emphasizes the relationship between hubs and spokes. When entering
a spoke, the screen slides up to reveal the spoke being entered. When
returning to a hub, the hub slides down over the spoke being finished.
For hub->hub (or other standalone) transitions, the old screen slides
left (or right, in RTL languages) to reveal the new screen.

Thanks to Ryan Lerch for thinking of the idea and Máirín Duffy for
coming up with transition types that look nice.
---
 pyanaconda/ui/gui/__init__.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 0d94d33..bd6941d 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -291,7 +291,9 @@ class MainWindow(Gtk.Window):
         self._overlay_depth = 0
 
         # Create a stack and a list of what's been added to the stack
-        self._stack = Gtk.Stack()
+        # Double the stack transition duration since the default 200ms is too
+        # quick to get the point across
+        self._stack = Gtk.Stack(transition_duration=400)
         self._stack_contents = set()
 
         # Create an accel group for the F12 accelerators added after window transitions
@@ -390,6 +392,9 @@ class MainWindow(Gtk.Window):
 
            :param AnacondaWidgets.BaseStandalone standalone: the new standalone action
         """
+        # Slide the old hub/standalone off of the new one
+        self._stack.set_transition_type(Gtk.StackTransitionType.UNDER_LEFT)
+
         self._current_action = standalone
         self._setVisibleChild(standalone)
 
@@ -401,10 +406,16 @@ class MainWindow(Gtk.Window):
 
            :param AnacondaWidgets.SpokeWindow spoke: a spoke to enter
         """
+        # Slide up, as if the spoke is under the hub
+        self._stack.set_transition_type(Gtk.StackTransitionType.UNDER_UP)
+
         self._setVisibleChild(spoke)
 
     def returnToHub(self):
         """Exit a spoke and return to a hub."""
+        # Slide back down over the spoke
+        self._stack.set_transition_type(Gtk.StackTransitionType.OVER_DOWN)
+
         self._setVisibleChild(self._current_action)
 
     def lightbox_on(self):
-- 
2.1.0



More information about the anaconda-patches mailing list