[gtk+/wip/gbsneto/other-locations] file chooser: Avoid animations when setting up
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gbsneto/other-locations] file chooser: Avoid animations when setting up
- Date: Sat, 11 Jul 2015 14:29:29 +0000 (UTC)
commit 02735d6669949be1eee6154029ce57a04b91acf0
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 8 20:15:07 2015 -0400
file chooser: Avoid animations when setting up
There is no need to animate things when we are just setting up
the startup mode, so disable transitions in the revealer and
the stack. Pointed out by Carlos Soriano
gtk/gtkfilechooserwidget.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index b185a13..01ae79f 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -3779,7 +3779,6 @@ recent_files_setting_is_enabled (GtkFileChooserWidget *impl)
settings = gtk_widget_get_settings (GTK_WIDGET (impl));
g_object_get (settings, "gtk-recent-files-enabled", &enabled, NULL);
-
return enabled;
}
@@ -3790,6 +3789,18 @@ static void
set_startup_mode (GtkFileChooserWidget *impl)
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
+ GtkRevealerTransitionType revealer_transition;
+ GtkStackTransitionType stack_transition;
+
+ /* turn off animations for this setup */
+ revealer_transition
+ = 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);
+ stack_transition
+ = gtk_stack_get_transition_type (GTK_STACK (priv->browse_header_stack));
+ gtk_stack_set_transition_type (GTK_STACK (priv->browse_header_stack),
+ GTK_STACK_TRANSITION_TYPE_NONE);
switch (priv->startup_mode)
{
@@ -3808,6 +3819,11 @@ set_startup_mode (GtkFileChooserWidget *impl)
default:
g_assert_not_reached ();
}
+
+ gtk_stack_set_transition_type (GTK_STACK (priv->browse_header_stack),
+ stack_transition);
+ gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+ revealer_transition);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]