[gtk+] stack: respect gtk-enable-animations setting



commit fb9ff442997f02ee2d6ad0eae0321a961e96f56f
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 18 23:19:27 2013 -0500

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

 gtk/gtkstack.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 1f0da9e..a284a66 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -45,6 +45,9 @@
  * These animations respect the #GtkSettings::gtk-enable-animations
  * setting.
  *
+ * These animations respect the #GtkSettings::gtk-enable-animations
+ * setting.
+ *    
  * The GtkStack widget was added in GTK+ 3.10.
  */
 
@@ -827,6 +830,14 @@ static GtkStackTransitionType
 effective_transition_type (GtkStack               *stack,
                            GtkStackTransitionType  transition_type)
 {
+  gboolean animations_enabled;
+
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (stack)),
+                "gtk-enable-animations", &animations_enabled,
+                NULL);
+  if (!animations_enabled)
+    return GTK_STACK_TRANSITION_TYPE_NONE;
+
   if (gtk_widget_get_direction (GTK_WIDGET (stack)) == GTK_TEXT_DIR_RTL)
     {
       if (transition_type == GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT)


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