[gnome-panel] panel: Remove global enable_animations key



commit 738de59f34e32033f5eb1aafe7f147ca6b12cca7
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Mar 23 18:27:01 2011 +0100

    panel: Remove global enable_animations key
    
    Instead, we simply use the gtk-enable-animations property of
    GtkSettings.

 data/org.gnome.gnome-panel.gschema.xml |    4 ----
 gnome-panel/launcher.c                 |   32 ++++++++++++++++++++++----------
 gnome-panel/panel-config-global.c      |   13 -------------
 gnome-panel/panel-config-global.h      |    1 -
 gnome-panel/panel-global.schemas.in    |    2 +-
 5 files changed, 23 insertions(+), 29 deletions(-)
---
diff --git a/data/org.gnome.gnome-panel.gschema.xml b/data/org.gnome.gnome-panel.gschema.xml
index 956790c..5315df0 100644
--- a/data/org.gnome.gnome-panel.gschema.xml
+++ b/data/org.gnome.gnome-panel.gschema.xml
@@ -13,10 +13,6 @@
       <summary>Enable tooltips</summary>
       <description>If true, tooltips are shown for objects in panels.</description>
     </key>
-    <key name="enable-animations" type="b">
-      <default>true</default>
-      <summary>Enable animations</summary>
-    </key>
     <key name="confirm-panel-removal" type="b">
       <default>true</default>
       <summary>Confirm panel removal</summary>
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 5f1b70d..916fa8e 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -96,6 +96,26 @@ launcher_register_error_dialog (Launcher *launcher,
 }
 
 static void
+launcher_do_zoom_animation (GtkWidget *widget)
+{
+	GtkSettings *settings;
+	gboolean     enable_animations;
+
+	settings = gtk_widget_get_settings (widget);
+
+	enable_animations = TRUE;
+	g_object_get (settings,
+		      "gtk-enable-animations", &enable_animations,
+		      NULL);
+
+	if (enable_animations)
+		xstuff_zoom_animate (widget,
+				     button_widget_get_pixbuf (BUTTON_WIDGET (widget)),
+				     button_widget_get_orientation (BUTTON_WIDGET (widget)),
+				     NULL);
+}
+
+static void
 launch_url (Launcher *launcher)
 {
 	char *url;
@@ -135,11 +155,7 @@ launcher_launch (Launcher  *launcher,
 	g_return_if_fail (launcher != NULL);
 	g_return_if_fail (launcher->key_file != NULL);
 
-	if (panel_global_config_get_enable_animations ())
-		xstuff_zoom_animate (widget,
-				     button_widget_get_pixbuf (BUTTON_WIDGET (widget)),
-				     button_widget_get_orientation (BUTTON_WIDGET (widget)),
-				     NULL);
+	launcher_do_zoom_animation (widget);
 	
 	type = panel_key_file_get_string (launcher->key_file, "Type");
 	if (type && !strcmp (type, "Link"))
@@ -181,11 +197,7 @@ drag_data_received_cb (GtkWidget        *widget,
 	int      i;
 	GList   *file_list;
 
-	if (panel_global_config_get_enable_animations ())
-		xstuff_zoom_animate (widget,
-				     button_widget_get_pixbuf (BUTTON_WIDGET (widget)),
-				     button_widget_get_orientation (BUTTON_WIDGET (widget)),
-				     NULL);
+	launcher_do_zoom_animation (widget);
 	
 	file_list = NULL;
 	uris = g_uri_list_extract_uris ((const char *) gtk_selection_data_get_data (selection_data));
diff --git a/gnome-panel/panel-config-global.c b/gnome-panel/panel-config-global.c
index 34a8908..8b2d4d9 100644
--- a/gnome-panel/panel-config-global.c
+++ b/gnome-panel/panel-config-global.c
@@ -35,7 +35,6 @@
 
 typedef struct {
 	guint               tooltips_enabled : 1;
-	guint               enable_animations : 1;
 	guint               confirm_panel_remove : 1;
 	guint               highlight_when_over : 1;
 } GlobalConfig;
@@ -52,14 +51,6 @@ panel_global_config_get_highlight_when_over (void)
 }
 
 gboolean
-panel_global_config_get_enable_animations (void)
-{
-	g_assert (global_config_initialised == TRUE);
-
-	return global_config.enable_animations;
-}
-
-gboolean
 panel_global_config_get_tooltips_enabled (void)
 {
 	g_assert (global_config_initialised == TRUE);
@@ -93,10 +84,6 @@ panel_global_config_set_entry (GConfEntry *entry)
 		global_config.tooltips_enabled =
 				gconf_value_get_bool (value);
 
-	else if (strcmp (key, "enable_animations") == 0)
-		global_config.enable_animations =
-				gconf_value_get_bool (value);
-
 	else if (strcmp (key, "confirm_panel_remove") == 0)
 		global_config.confirm_panel_remove =
 			gconf_value_get_bool (value);
diff --git a/gnome-panel/panel-config-global.h b/gnome-panel/panel-config-global.h
index 2b436e2..89759c4 100644
--- a/gnome-panel/panel-config-global.h
+++ b/gnome-panel/panel-config-global.h
@@ -33,7 +33,6 @@ G_BEGIN_DECLS
 void panel_global_config_load (void);
 
 gboolean panel_global_config_get_highlight_when_over  (void);
-gboolean panel_global_config_get_enable_animations    (void);
 gboolean panel_global_config_get_tooltips_enabled     (void);
 gboolean panel_global_config_get_confirm_panel_remove (void);
 
diff --git a/gnome-panel/panel-global.schemas.in b/gnome-panel/panel-global.schemas.in
index 3cadc79..026b10c 100644
--- a/gnome-panel/panel-global.schemas.in
+++ b/gnome-panel/panel-global.schemas.in
@@ -39,7 +39,7 @@ Panel Global Config Schema File -  work in progress
         <type>bool</type>
         <default>true</default>
         <locale name="C">
-          <short>Enable animations</short>
+          <short>Deprecated</short>
           <long></long>
         </locale>
       </schema>



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