[gtk+] Deprecate and hardcode default toolbar style setting



commit 425e977bb65a52c05fbc2b643acf32aec4bc477f
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Jul 8 13:28:48 2013 -0400

    Deprecate and hardcode default toolbar style setting
    
    Toolbar style can still be changed on a per-widget basis as
    needed by the application developer.

 gdk/wayland/gdkscreen-wayland.c |    1 -
 gdk/win32/gdkproperty-win32.c   |    1 -
 gdk/x11/gdksettings.c           |    1 -
 gtk/gtksettings.c               |    4 +++-
 gtk/gtktoolbar.c                |   29 +++--------------------------
 gtk/gtktoolpalette.c            |   26 ++------------------------
 6 files changed, 8 insertions(+), 54 deletions(-)
---
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 6768fab..4ef5ee2 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -499,7 +499,6 @@ static TranslationEntry translations[] = {
   { "org.gnome.desktop.interface", "font-name", "gtk-font-name", G_TYPE_STRING, { .s = "Cantarell 11" } },
   { "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
   { "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE 
} },
-  { "org.gnome.desktop.interface", "toolbar-style", "gtk-toolbar-style", G_TYPE_STRING, { .s = "both-horiz"} 
},
   { "org.gnome.desktop.interface", "toolbar-icons-size", "gtk-toolbar-icon-size", G_TYPE_STRING, { .s = 
"large"} },
   { "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i 
= 250 } },
   { "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, 
{.i = 8 } },
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index 11268ab..cb2a08d 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -308,7 +308,6 @@ _gdk_win32_window_delete_property (GdkWindow *window,
   "Gtk/ColorPalette\0"        "gtk-color-palette\0"
   "Gtk/FontName\0"            "gtk-font-name\0"
   "Gtk/KeyThemeName\0"        "gtk-key-theme-name\0"
-  "Gtk/ToolbarStyle\0"        "gtk-toolbar-style\0"
   "Gtk/ToolbarIconSize\0"     "gtk-toolbar-icon-size\0"
   "Gtk/Modules\0"             "gtk-modules\0"
   "Gtk/CursorThemeName\0"     "gtk-cursor-theme-name\0"
diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c
index bffcb05..8f2adb3 100644
--- a/gdk/x11/gdksettings.c
+++ b/gdk/x11/gdksettings.c
@@ -33,7 +33,6 @@ static const struct {
   {"Gtk/ColorPalette",        "gtk-color-palette"},
   {"Gtk/FontName",            "gtk-font-name"},
   {"Gtk/KeyThemeName",        "gtk-key-theme-name"},
-  {"Gtk/ToolbarStyle",        "gtk-toolbar-style"},
   {"Gtk/ToolbarIconSize",     "gtk-toolbar-icon-size"},
   {"Gtk/Modules",             "gtk-modules"},
   {"Gtk/CursorThemeName",     "gtk-cursor-theme-name"},
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index ceaec85..472a480 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1173,13 +1173,15 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * GtkSettings:gtk-toolbar-style:
    *
    * The size of icons in default toolbars.
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_enum ("gtk-toolbar-style",
                                                                    P_("Toolbar style"),
                                                                    P_("Whether default toolbars have text 
only, text and icons, icons only, etc."),
                                                                    GTK_TYPE_TOOLBAR_STYLE,
-                                                                   GTK_TOOLBAR_BOTH,
+                                                                   GTK_TOOLBAR_BOTH_HORIZ,
                                                                    GTK_PARAM_READWRITE),
                                              gtk_rc_property_parse_enum);
   g_assert (result == PROP_TOOLBAR_STYLE);
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index e4dbfa4..9412cc0 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -91,7 +91,7 @@ typedef struct _ToolbarContent ToolbarContent;
 #define SPACE_LINE_END      8.0
 
 #define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
-#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH
+#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH_HORIZ
 #define DEFAULT_ANIMATION_STATE TRUE
 
 #define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate
@@ -2017,19 +2017,6 @@ toolbar_get_settings (GtkToolbar *toolbar)
 }
 
 static void
-style_change_notify (GtkToolbar *toolbar)
-{
-  GtkToolbarPrivate *priv = toolbar->priv;
-
-  if (!priv->style_set)
-    {
-      /* pretend it was set, then unset, thus reverting to new default */
-      priv->style_set = TRUE;
-      gtk_toolbar_unset_style (toolbar);
-    }
-}
-
-static void
 icon_size_change_notify (GtkToolbar *toolbar)
 {
   GtkToolbarPrivate *priv = toolbar->priv;
@@ -2064,9 +2051,7 @@ settings_change_notify (GtkSettings      *settings,
                         const GParamSpec *pspec,
                         GtkToolbar       *toolbar)
 {
-  if (! strcmp (pspec->name, "gtk-toolbar-style"))
-    style_change_notify (toolbar);
-  else if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
+  if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
     icon_size_change_notify (toolbar);
   else if (! strcmp (pspec->name, "gtk-enable-animations"))
     animation_change_notify (toolbar);
@@ -2108,7 +2093,6 @@ gtk_toolbar_screen_changed (GtkWidget *widget,
   else
     priv->settings = NULL;
 
-  style_change_notify (toolbar);
   icon_size_change_notify (toolbar);
   animation_change_notify (toolbar);
 }
@@ -2910,14 +2894,7 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar)
 
   if (priv->style_set)
     {
-      GtkSettings *settings = toolbar_get_settings (toolbar);
-      
-      if (settings)
-       g_object_get (settings,
-                     "gtk-toolbar-style", &style,
-                     NULL);
-      else
-       style = DEFAULT_TOOLBAR_STYLE;
+      style = DEFAULT_TOOLBAR_STYLE;
 
       if (style != priv->style)
        g_signal_emit (toolbar, toolbar_signals[STYLE_CHANGED], 0, style);
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 7d29f81..a90a3e4 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -893,19 +893,6 @@ gtk_tool_palette_get_child_property (GtkContainer *container,
 }
 
 static void
-style_change_notify (GtkToolPalette *palette)
-{
-  GtkToolPalettePrivate* priv = palette->priv;
-
-  if (!priv->style_set)
-    {
-      /* pretend it was set, then unset, thus reverting to new default */
-      priv->style_set = TRUE;
-      gtk_tool_palette_unset_style (palette);
-    }
-}
-
-static void
 icon_size_change_notify (GtkToolPalette *palette)
 {
   GtkToolPalettePrivate* priv = palette->priv;
@@ -923,9 +910,7 @@ gtk_tool_palette_settings_change_notify (GtkSettings      *settings,
                                          const GParamSpec *pspec,
                                          GtkToolPalette   *palette)
 {
-  if (strcmp (pspec->name, "gtk-toolbar-style") == 0)
-    style_change_notify (palette);
-  else if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
+  if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
     icon_size_change_notify (palette);
 }
 
@@ -1251,14 +1236,7 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
 
   if (priv->style_set)
     {
-      GtkSettings *settings = toolpalette_get_settings (palette);
-
-      if (settings)
-        g_object_get (settings,
-                      "gtk-toolbar-style", &style,
-                      NULL);
-      else
-        style = DEFAULT_TOOLBAR_STYLE;
+      style = DEFAULT_TOOLBAR_STYLE;
 
       if (style != priv->style)
         gtk_tool_palette_change_style (palette, style);


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