Animate the transitions from one screen to another. Hopefully this will ease the confusion that some users experience with the hub and spoke model.
David Shea (2): Animate the screen transitions. Force a background in the main GtkBox in anaconda windows.
pyanaconda/ui/gui/__init__.py | 13 ++++++++++++- widgets/src/BaseWindow.c | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
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):
By default there is no background drawn, which is problematic for GtkStack transitions where a new screen slides over the old one. --- widgets/src/BaseWindow.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c index 9df46f5..a70f7cc 100644 --- a/widgets/src/BaseWindow.c +++ b/widgets/src/BaseWindow.c @@ -236,6 +236,7 @@ GtkWidget *anaconda_base_window_new() { static void anaconda_base_window_init(AnacondaBaseWindow *win) { char *markup; AtkObject *atk; + GtkStyleContext *context;
win->priv = G_TYPE_INSTANCE_GET_PRIVATE(win, ANACONDA_TYPE_BASE_WINDOW, @@ -263,6 +264,13 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) { win->priv->main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_container_add(GTK_CONTAINER(win), win->priv->main_box);
+ /* GtkBoxes don't draw a background by default, which causes issues during + * transitions in a GtkStack. Work around this by forcing a "background" + * style class. See https://bugzilla.gnome.org/show_bug.cgi?id=742552 + */ + context = gtk_widget_get_style_context(win->priv->main_box); + gtk_style_context_add_class(context, "background"); + /* Then the navigation area that sits as the first item in the main box * for every Window class. */
On Thu, 2015-01-08 at 14:59 -0500, David Shea wrote:
Animate the transitions from one screen to another. Hopefully this will ease the confusion that some users experience with the hub and spoke model.
David Shea (2): Animate the screen transitions. Force a background in the main GtkBox in anaconda windows.
pyanaconda/ui/gui/__init__.py | 13 ++++++++++++- widgets/src/BaseWindow.c | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
Small code change and big UX improvement, nice! These both look good to me. Also thanks Máirín and Ryan!
On Fri, 2015-01-09 at 08:17 +0100, Vratislav Podzimek wrote:
On Thu, 2015-01-08 at 14:59 -0500, David Shea wrote:
Animate the transitions from one screen to another. Hopefully this will ease the confusion that some users experience with the hub and spoke model.
David Shea (2): Animate the screen transitions. Force a background in the main GtkBox in anaconda windows.
pyanaconda/ui/gui/__init__.py | 13 ++++++++++++- widgets/src/BaseWindow.c | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
Small code change and big UX improvement, nice! These both look good to me. Also thanks Máirín and Ryan!
Nice! :) Thanks a lot to everyone involved! :)
anaconda-patches@lists.fedorahosted.org