[gnome-builder] libide: allow disabling animations with gtk-enable-animations gtksettings



commit 3ba30e967b4f5292c4a7cc095ef77c853fb84ddb
Author: Christian Hergert <christian hergert me>
Date:   Sun Mar 8 18:46:08 2015 -0700

    libide: allow disabling animations with gtk-enable-animations gtksettings

 libide/ide-source-view.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 1df0f91..65b37d0 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -2087,14 +2087,22 @@ static void
 ide_source_view_real_selection_theatric (IdeSourceView         *self,
                                          IdeSourceViewTheatric  theatric)
 {
+  GtkSettings *settings;
   GtkTextBuffer *buffer;
   GtkTextIter begin;
   GtkTextIter end;
+  gboolean enable_animations = TRUE;
 
   g_assert (IDE_IS_SOURCE_VIEW (self));
   g_assert ((theatric == IDE_SOURCE_VIEW_THEATRIC_EXPAND) ||
             (theatric == IDE_SOURCE_VIEW_THEATRIC_SHRINK));
 
+  settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (self)));
+  g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
+
+  if (!enable_animations)
+    return;
+
   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
   gtk_text_buffer_get_selection_bounds (buffer, &begin, &end);
   gtk_text_iter_order (&begin, &end);


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