[PATCH] Make rubberband fade obey global animation setting.

Arthur Taylor <[email protected]>
Newsgroups gmane.comp.gnome.nautilus
Message-ID <[email protected]>
The rubberband fade-out effect should observe the global animation
setting, intened to make life easier for people running
resource contrained setups (like X11 over a network.)

Signed-off-by: Arthur Taylor <[email protected]>
---
 libnautilus-private/nautilus-global-preferences.c |    1 +
 libnautilus-private/nautilus-global-preferences.h |    4 ++++
 libnautilus-private/nautilus-icon-container.c     |    8 +++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c
index bb618c6..0fce56b 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -77,4 +77,5 @@ nautilus_global_preferences_init (void)
 	nautilus_tree_sidebar_preferences = g_settings_new("org.gnome.nautilus.sidebar-panels.tree");
 	gnome_lockdown_preferences = g_settings_new("org.gnome.desktop.lockdown");
 	gnome_background_preferences = g_settings_new("org.gnome.desktop.background");
+	gnome_interface_preferences = g_settings_new("org.gnome.desktop.interface");
 }
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 89cd8ed..72bdc34 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -186,6 +186,9 @@ typedef enum
 /* Desktop background */
 #define NAUTILUS_PREFERENCES_SHOW_DESKTOP		   "show-desktop-icons"
 
+/* Interface animation key */
+#define NAUTILUS_PREFERENCES_ENABLE_ANIMATIONS		   "enable-animations"
+
 
 void nautilus_global_preferences_init                      (void);
 char *nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (void);
@@ -199,6 +202,7 @@ GSettings *nautilus_tree_sidebar_preferences;
 GSettings *nautilus_window_state;
 GSettings *gnome_lockdown_preferences;
 GSettings *gnome_background_preferences;
+GSettings *gnome_interface_preferences;
 
 G_END_DECLS
 
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 942d17a..d7088df 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -2700,7 +2700,13 @@ stop_rubberbanding (NautilusIconContainer *container,
 	/* Destroy this canvas item; the parent will unref it. */
 	eel_canvas_item_ungrab (band_info->selection_rectangle, time);
 	eel_canvas_item_lower_to_bottom (band_info->selection_rectangle);
-	nautilus_selection_canvas_item_fade_out (NAUTILUS_SELECTION_CANVAS_ITEM (band_info->selection_rectangle), 150);
+	if (g_settings_get_boolean (gnome_interface_preferences,
+		NAUTILUS_PREFERENCES_ENABLE_ANIMATIONS)) {
+		nautilus_selection_canvas_item_fade_out (
+			NAUTILUS_SELECTION_CANVAS_ITEM (band_info->selection_rectangle), 150);
+	} else {
+		eel_canvas_item_destroy (band_info->selection_rectangle);
+	}
 	band_info->selection_rectangle = NULL;
 
 	/* if only one item has been selected, use it as range
-- 
1.7.8.4

-- 
nautilus-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/nautilus-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.