[gtk] gtkfilechooserwidget: Temporarily disable revealer transitions...



commit 59313e145973555227147e89694393c000d4a4e7
Author: Timm Bäder <mail baedert org>
Date:   Fri Jul 19 09:36:25 2019 +0200

    gtkfilechooserwidget: Temporarily disable revealer transitions...
    
    ... when going between recent and browse. It just looks weird to have
    this transition while the treeview model is just cleared/repopulated
    without any transition.

 gtk/gtkfilechooserwidget.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index c419e16d9c..0a37e2834d 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -3051,12 +3051,20 @@ static void
 operation_mode_set_browse (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
+  GtkRevealerTransitionType old_revealer_transition_type;
 
   gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), priv->current_folder);
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
   location_mode_set (impl, LOCATION_MODE_PATH_BAR);
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+
+  old_revealer_transition_type = gtk_revealer_get_transition_type (GTK_REVEALER 
(priv->browse_header_revealer));
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    GTK_REVEALER_TRANSITION_TYPE_NONE);
   gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    old_revealer_transition_type);
+
   gtk_widget_set_sensitive (priv->filter_combo, TRUE);
   g_object_notify (G_OBJECT (impl), "subtitle");
 }
@@ -3090,10 +3098,19 @@ operation_mode_set_recent (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
   GFile *file;
+  GtkRevealerTransitionType old_revealer_transition_type;
 
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+
+  /* Hide browse_header without a transition */
+  old_revealer_transition_type = gtk_revealer_get_transition_type (GTK_REVEALER 
(priv->browse_header_revealer));
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    GTK_REVEALER_TRANSITION_TYPE_NONE);
   gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), FALSE);
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    old_revealer_transition_type);
+
   location_bar_update (impl);
   recent_start_loading (impl);
   file = g_file_new_for_uri ("recent:///");


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