[gtk+] Deprecate and ignore timeout-expand setting



commit dae6afc847110b533e95b4df318d7e2163a53809
Author: William Jon McCann <william jon mccann gmail com>
Date:   Tue Jul 9 16:47:59 2013 -0400

    Deprecate and ignore timeout-expand setting

 gtk/gtkexpander.c      |    9 ++-------
 gtk/gtkplacessidebar.c |    9 ++-------
 gtk/gtksettings.c      |    7 ++++++-
 3 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index dac0746..60c82da 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -117,6 +117,7 @@
 
 #define DEFAULT_EXPANDER_SIZE 10
 #define DEFAULT_EXPANDER_SPACING 2
+#define TIMEOUT_EXPAND 500
 
 enum
 {
@@ -1144,13 +1145,7 @@ gtk_expander_drag_motion (GtkWidget        *widget,
 
   if (!priv->expanded && !priv->expand_timer)
     {
-      GtkSettings *settings;
-      guint timeout;
-
-      settings = gtk_widget_get_settings (widget);
-      g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-
-      priv->expand_timer = gdk_threads_add_timeout (timeout, (GSourceFunc) expand_timeout, expander);
+      priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
     }
 
   return TRUE;
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 5b59739..b548682 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -104,6 +104,7 @@
 
 #define EJECT_BUTTON_XPAD 6
 #define ICON_CELL_XPAD 6
+#define TIMEOUT_EXPAND 500
 
 #define DO_NOT_COMPILE 0
 
@@ -1470,23 +1471,17 @@ switch_location_timer (gpointer user_data)
 static void
 check_switch_location_timer (GtkPlacesSidebar *sidebar, const char *uri)
 {
-       GtkSettings *settings;
-       guint timeout;
-
        if (g_strcmp0 (uri, sidebar->drop_target_uri) == 0) {
                return;
        }
        remove_switch_location_timer (sidebar);
 
-       settings = gtk_widget_get_settings (GTK_WIDGET (sidebar));
-       g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-
        g_free (sidebar->drop_target_uri);
        sidebar->drop_target_uri = NULL;
 
        if (uri != NULL) {
                sidebar->drop_target_uri = g_strdup (uri);
-               sidebar->switch_location_timer = gdk_threads_add_timeout (timeout, switch_location_timer, 
sidebar);
+               sidebar->switch_location_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, 
switch_location_timer, sidebar);
        }
 }
 
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index e5d31c4..fadb395 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -694,12 +694,17 @@ gtk_settings_class_init (GtkSettingsClass *class)
 
   g_assert (result == PROP_TIMEOUT_REPEAT);
 
+  /**
+   * GtkSettings:gtk-timeout-expand:
+   *
+   * Deprecated: 3.10: This setting is ignored.
+   */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-timeout-expand",
                                                                P_("Expand timeout"),
                                                                P_("Expand value for timeouts, when a widget 
is expanding a new region"),
                                                                0, G_MAXINT, DEFAULT_TIMEOUT_EXPAND,
-                                                               GTK_PARAM_READWRITE),
+                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
                                              NULL);
 
   g_assert (result == PROP_TIMEOUT_EXPAND);


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