[gtk+] revealer: Respect gtk-enable-animations setting



commit bf9ed44aa69f3a4c238f05456d462877fea601f7
Author: Christian Persch <chpe gnome org>
Date:   Mon Nov 18 21:21:49 2013 +0100

    revealer: Respect gtk-enable-animations setting
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712632

 gtk/gtkrevealer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index d872fcd..8ecff6c 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -41,6 +41,9 @@
  * The style of transition can be controlled with
  * gtk_revealer_set_transition_type().
  *
+ * These animations respect the #GtkSettings::gtk-enable-animations
+ * setting.
+ *
  * The GtkRevealer widget was added in GTK+ 3.10.
  */
 
@@ -268,6 +271,13 @@ static GtkRevealerTransitionType
 effective_transition (GtkRevealer *revealer)
 {
   GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
+  gboolean animations_enabled;
+
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (revealer)),
+                "gtk-enable-animations", &animations_enabled,
+                NULL);
+  if (!animations_enabled)
+    return GTK_REVEALER_TRANSITION_TYPE_NONE;
 
   if (gtk_widget_get_direction (GTK_WIDGET (revealer)) == GTK_TEXT_DIR_RTL)
     {


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