[nautilus] background: make the fading effect optional (#623174)



commit 01f39f471005e788281c18da30563c0184434fff
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Oct 13 17:57:05 2010 +0200

    background: make the fading effect optional (#623174)
    
    This is implemented with a GSettings key. Thanks to Brian Cameron for
    the initial patch.

 libnautilus-private/nautilus-desktop-background.c  |    8 ++++++++
 libnautilus-private/nautilus-global-preferences.h  |    1 +
 .../org.gnome.nautilus.gschema.xml.in              |    5 +++++
 3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-desktop-background.c b/libnautilus-private/nautilus-desktop-background.c
index 3789d00..7a71f7d 100644
--- a/libnautilus-private/nautilus-desktop-background.c
+++ b/libnautilus-private/nautilus-desktop-background.c
@@ -151,12 +151,20 @@ static void
 init_fade (NautilusDesktopBackground *self)
 {
 	GtkWidget *widget;
+	gboolean do_fade;
 
 	widget = self->details->widget;
 
 	if (widget == NULL || !gtk_widget_get_realized (widget))
 		return;
 
+	do_fade = g_settings_get_boolean (nautilus_desktop_preferences,
+					  NAUTILUS_PREFERENCES_DESKTOP_BACKGROUND_FADE);
+
+	if (!do_fade) {
+		return;
+	}
+
 	if (self->details->fade == NULL) {
 		GdkWindow *window;
 		GdkScreen *screen;
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 23b8194..2847be1 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -193,6 +193,7 @@ typedef enum
 #define NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE	   "volumes-visible"
 #define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_VISIBLE       "network-icon-visible"
 #define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_NAME          "network-icon-name"
+#define NAUTILUS_PREFERENCES_DESKTOP_BACKGROUND_FADE       "background-fade"
 
 /* Lockdown */
 #define NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE         "disable-command-line"
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index fa2806e..0e5352f 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -366,6 +366,11 @@
       <_summary>Text Ellipsis Limit</_summary>
       <_description>An integer specifying how parts of overlong file names should be replaced by ellipses on the desktop. If the number is larger than 0, the file name will not exceed the given number of lines. If the number is 0 or smaller, no limit is imposed on the number of displayed lines.</_description>
     </key>
+    <key name="background-fade" type="b">
+      <default>true</default>
+      <_summary>Fade the background on change</_summary>
+      <_description>If set to true, then Nautilus will use a fade effect to change the desktop background.</_description>
+    </key>
   </schema>
 
   <schema id="org.gnome.nautilus.window-state" path="/apps/nautilus/window-state/" gettext-domain="nautilus">



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