[gnome-software/wip/kalev/left-right-transition] update dialog: Use left/right slide-in transition between pages



commit aa6c8bc48743869b7fe8305a7fde2e99525accd4
Author: Kalev Lember <klember redhat com>
Date:   Sat Aug 29 18:33:10 2015 +0200

    update dialog: Use left/right slide-in transition between pages

 src/gs-update-dialog.c  |    8 ++++++++
 src/gs-update-dialog.ui |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 676ccea..675661d 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -330,9 +330,13 @@ gs_update_dialog_show_update_details (GsUpdateDialog *dialog, GsApp *app)
                        gtk_widget_show_all (row);
                        gtk_list_box_insert (GTK_LIST_BOX (priv->list_box), row, -1);
                }
+               gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT);
                gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "os-update-list");
+               gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_NONE);
        } else {
+               gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT);
                gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "package-details");
+               gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_NONE);
        }
 }
 
@@ -367,7 +371,11 @@ button_back_cb (GtkWidget *widget, GsUpdateDialog *dialog)
 
        /* return to the previous view */
        entry = g_queue_pop_head (priv->back_entry_stack);
+
+       gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT);
        gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), entry->stack_page);
+       gtk_stack_set_transition_type (GTK_STACK (priv->stack), GTK_STACK_TRANSITION_TYPE_NONE);
+
        gtk_window_set_title (GTK_WINDOW (dialog), entry->title);
        if (entry->focus)
                gtk_widget_grab_focus (entry->focus);
diff --git a/src/gs-update-dialog.ui b/src/gs-update-dialog.ui
index 70f49ee..bdc9337 100644
--- a/src/gs-update-dialog.ui
+++ b/src/gs-update-dialog.ui
@@ -49,6 +49,7 @@
           <object class="GtkStack" id="stack">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="transition_duration">300</property>
             <child>
               <object class="GtkBox" id="box_spinner">
                 <property name="visible">True</property>


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