[gtk+/wip/otte/icon-size: 4/20] toolbar: Remove icon sizes



commit 9ba440140a0e0c0b460d84dbccfe5365f99e1867
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jan 20 03:16:39 2017 +0100

    toolbar: Remove icon sizes

 docs/reference/gtk/gtk4-sections.txt       |    8 --
 gtk/gtkcustompaperunixdialog.c             |    1 -
 gtk/gtktoolbar.c                           |  160 ----------------------------
 gtk/gtktoolbar.h                           |    8 --
 gtk/gtktoolbutton.c                        |    6 +-
 gtk/gtktoolitem.c                          |   27 -----
 gtk/gtktoolitem.h                          |    2 -
 gtk/gtktoolitemgroup.c                     |   12 --
 gtk/gtktoolpalette.c                       |  158 ---------------------------
 gtk/gtktoolpalette.h                       |    7 --
 gtk/gtktoolshell.c                         |   17 ---
 gtk/gtktoolshell.h                         |    4 -
 tests/testtoolbar.c                        |   52 ---------
 tests/visuals/inline-toolbar-horizontal.ui |    1 -
 tests/visuals/inline-toolbar-vertical.ui   |    1 -
 testsuite/gtk/object.c                     |    1 -
 16 files changed, 2 insertions(+), 463 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index a9bfe56..ca53949 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -3216,7 +3216,6 @@ GtkToggleButtonPrivate
 GtkToolShell
 GtkToolShellIface
 gtk_tool_shell_get_ellipsize_mode
-gtk_tool_shell_get_icon_size
 gtk_tool_shell_get_orientation
 gtk_tool_shell_get_style
 gtk_tool_shell_get_text_alignment
@@ -3246,13 +3245,10 @@ gtk_toolbar_get_nth_item
 gtk_toolbar_get_drop_index
 gtk_toolbar_set_drop_highlight_item
 gtk_toolbar_set_show_arrow
-gtk_toolbar_unset_icon_size
 gtk_toolbar_get_show_arrow
 gtk_toolbar_get_style
-gtk_toolbar_get_icon_size
 
 gtk_toolbar_set_style
-gtk_toolbar_set_icon_size
 gtk_toolbar_unset_style
 
 <SUBSECTION Standard>
@@ -3288,7 +3284,6 @@ gtk_tool_item_get_visible_vertical
 gtk_tool_item_set_is_important
 gtk_tool_item_get_is_important
 gtk_tool_item_get_ellipsize_mode
-gtk_tool_item_get_icon_size
 gtk_tool_item_get_orientation
 gtk_tool_item_get_toolbar_style
 gtk_tool_item_get_text_alignment
@@ -3480,9 +3475,6 @@ gtk_tool_palette_get_expand
 gtk_tool_palette_set_expand
 gtk_tool_palette_get_group_position
 gtk_tool_palette_set_group_position
-gtk_tool_palette_get_icon_size
-gtk_tool_palette_set_icon_size
-gtk_tool_palette_unset_icon_size
 gtk_tool_palette_get_style
 gtk_tool_palette_set_style
 gtk_tool_palette_unset_style
diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c
index 9bfa7be..77d2ab0 100644
--- a/gtk/gtkcustompaperunixdialog.c
+++ b/gtk/gtkcustompaperunixdialog.c
@@ -1074,7 +1074,6 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
   gtk_widget_show (treeview);
 
   toolbar = gtk_toolbar_new ();
-  gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
 
   context = gtk_widget_get_style_context (toolbar);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index db198b3..4000f54 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -98,7 +98,6 @@ typedef struct _ToolbarContent ToolbarContent;
 #define SPACE_LINE_START    2.0
 #define SPACE_LINE_END      8.0
 
-#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
 #define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH_HORIZ
 #define DEFAULT_ANIMATION_STATE TRUE
 
@@ -115,7 +114,6 @@ struct _GtkToolbarPrivate
   GtkMenu         *menu;
   GtkSettings     *settings;
 
-  GtkIconSize      icon_size;
   GtkToolbarStyle  style;
 
   GtkToolItem     *highlight_tool_item;
@@ -144,7 +142,6 @@ struct _GtkToolbarPrivate
   GtkOrientation   orientation;
 
   guint            animation : 1;
-  guint            icon_size_set : 1;
   guint            is_sliding : 1;
   guint            need_rebuild : 1;  /* whether the overflow menu should be regenerated */
   guint            need_sync : 1;
@@ -159,8 +156,6 @@ enum {
   PROP_TOOLBAR_STYLE,
   PROP_SHOW_ARROW,
   PROP_TOOLTIPS,
-  PROP_ICON_SIZE,
-  PROP_ICON_SIZE_SET
 };
 
 /* Child properties */
@@ -339,7 +334,6 @@ static void        toolbar_content_set_expand           (ToolbarContent      *content,
                                                             gboolean             expand);
 
 static void            toolbar_tool_shell_iface_init        (GtkToolShellIface   *iface);
-static GtkIconSize     toolbar_get_icon_size                (GtkToolShell        *shell);
 static GtkOrientation  toolbar_get_orientation              (GtkToolShell        *shell);
 static GtkToolbarStyle toolbar_get_style                    (GtkToolShell        *shell);
 static void            toolbar_rebuild_menu                 (GtkToolShell        *shell);
@@ -538,43 +532,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
                                                         TRUE,
                                                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
 
-  /**
-   * GtkToolbar:icon-size:
-   *
-   * The size of the icons in a toolbar is normally determined by
-   * the toolbar-icon-size setting. When this property is set, it 
-   * overrides the setting. 
-   * 
-   * This should only be used for special-purpose toolbars, normal
-   * application toolbars should respect the user preferences for the
-   * size of icons.
-   *
-   * Since: 2.10
-   */
-  g_object_class_install_property (gobject_class,
-                                  PROP_ICON_SIZE,
-                                  g_param_spec_enum ("icon-size",
-                                                      P_("Icon size"),
-                                                      P_("Size of icons in this toolbar"),
-                                                      GTK_TYPE_ICON_SIZE,
-                                                      DEFAULT_ICON_SIZE,
-                                                      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  /**
-   * GtkToolbar:icon-size-set:
-   *
-   * Is %TRUE if the icon-size property has been set.
-   *
-   * Since: 2.10
-   */
-  g_object_class_install_property (gobject_class,
-                                  PROP_ICON_SIZE_SET,
-                                  g_param_spec_boolean ("icon-size-set",
-                                                        P_("Icon size set"),
-                                                        P_("Whether the icon-size property has been set"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE));  
-
   /* child properties */
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_EXPAND,
@@ -621,7 +578,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
 static void
 toolbar_tool_shell_iface_init (GtkToolShellIface *iface)
 {
-  iface->get_icon_size    = toolbar_get_icon_size;
   iface->get_orientation  = toolbar_get_orientation;
   iface->get_style        = toolbar_get_style;
   iface->rebuild_menu     = toolbar_rebuild_menu;
@@ -643,7 +599,6 @@ gtk_toolbar_init (GtkToolbar *toolbar)
 
   priv->orientation = GTK_ORIENTATION_HORIZONTAL;
   priv->style = DEFAULT_TOOLBAR_STYLE;
-  priv->icon_size = DEFAULT_ICON_SIZE;
   priv->animation = DEFAULT_ANIMATION_STATE;
 
   _gtk_orientable_set_style_classes (GTK_ORIENTABLE (toolbar));
@@ -694,7 +649,6 @@ gtk_toolbar_set_property (GObject      *object,
                          GParamSpec   *pspec)
 {
   GtkToolbar *toolbar = GTK_TOOLBAR (object);
-  GtkToolbarPrivate *priv = toolbar->priv;
 
   switch (prop_id)
     {
@@ -708,15 +662,6 @@ gtk_toolbar_set_property (GObject      *object,
     case PROP_SHOW_ARROW:
       gtk_toolbar_set_show_arrow (toolbar, g_value_get_boolean (value));
       break;
-    case PROP_ICON_SIZE:
-      gtk_toolbar_set_icon_size (toolbar, g_value_get_enum (value));
-      break;
-    case PROP_ICON_SIZE_SET:
-      if (g_value_get_boolean (value))
-       priv->icon_size_set = TRUE;
-      else
-       gtk_toolbar_unset_icon_size (toolbar);
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -743,12 +688,6 @@ gtk_toolbar_get_property (GObject    *object,
     case PROP_SHOW_ARROW:
       g_value_set_boolean (value, priv->show_arrow);
       break;
-    case PROP_ICON_SIZE:
-      g_value_set_enum (value, gtk_toolbar_get_icon_size (toolbar));
-      break;
-    case PROP_ICON_SIZE_SET:
-      g_value_set_boolean (value, priv->icon_size_set);
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -2817,22 +2756,6 @@ gtk_toolbar_get_nth_item (GtkToolbar *toolbar,
 }
 
 /**
- * gtk_toolbar_get_icon_size:
- * @toolbar: a #GtkToolbar
- *
- * Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
- *
- * Returns: the current icon size for the icons on the toolbar.
- **/
-GtkIconSize
-gtk_toolbar_get_icon_size (GtkToolbar *toolbar)
-{
-  g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), DEFAULT_ICON_SIZE);
-
-  return toolbar->priv->icon_size;
-}
-
-/**
  * gtk_toolbar_set_show_arrow:
  * @toolbar: a #GtkToolbar
  * @show_arrow: Whether to show an overflow menu
@@ -2964,80 +2887,6 @@ gtk_toolbar_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_toolbar_parent_class)->finalize (object);
 }
 
-/**
- * gtk_toolbar_set_icon_size:
- * @toolbar: A #GtkToolbar
- * @icon_size: The #GtkIconSize that stock icons in the toolbar shall have.
- *
- * This function sets the size of stock icons in the toolbar. You
- * can call it both before you add the icons and after they’ve been
- * added. The size you set will override user preferences for the default
- * icon size.
- * 
- * This should only be used for special-purpose toolbars, normal
- * application toolbars should respect the user preferences for the
- * size of icons.
- **/
-void
-gtk_toolbar_set_icon_size (GtkToolbar  *toolbar,
-                          GtkIconSize  icon_size)
-{
-  GtkToolbarPrivate *priv;
-
-  g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
-  g_return_if_fail (icon_size != GTK_ICON_SIZE_INVALID);
-
-  priv = toolbar->priv;
-
-  if (!priv->icon_size_set)
-    {
-      priv->icon_size_set = TRUE;
-      g_object_notify (G_OBJECT (toolbar), "icon-size-set");
-    }
-
-  if (priv->icon_size == icon_size)
-    return;
-
-  priv->icon_size = icon_size;
-  g_object_notify (G_OBJECT (toolbar), "icon-size");
-  
-  gtk_toolbar_reconfigured (toolbar);
-  
-  gtk_widget_queue_resize (GTK_WIDGET (toolbar));
-}
-
-/**
- * gtk_toolbar_unset_icon_size:
- * @toolbar: a #GtkToolbar
- * 
- * Unsets toolbar icon size set with gtk_toolbar_set_icon_size(), so that
- * user preferences will be used to determine the icon size.
- **/
-void
-gtk_toolbar_unset_icon_size (GtkToolbar *toolbar)
-{
-  GtkToolbarPrivate *priv;
-  GtkIconSize size;
-
-  g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
-
-  priv = toolbar->priv;
-
-  if (priv->icon_size_set)
-    {
-      size = DEFAULT_ICON_SIZE;
-
-      if (size != priv->icon_size)
-       {
-         gtk_toolbar_set_icon_size (toolbar, size);
-         g_object_notify (G_OBJECT (toolbar), "icon-size");      
-       }
-
-      priv->icon_size_set = FALSE;
-      g_object_notify (G_OBJECT (toolbar), "icon-size-set");      
-    }
-}
-
 /*
  * ToolbarContent methods
  */
@@ -3455,15 +3304,6 @@ _gtk_toolbar_elide_underscores (const gchar *original)
   return result;
 }
 
-static GtkIconSize
-toolbar_get_icon_size (GtkToolShell *shell)
-{
-  GtkToolbar *toolbar = GTK_TOOLBAR (shell);
-  GtkToolbarPrivate *priv = toolbar->priv;
-
-  return priv->icon_size;
-}
-
 static GtkOrientation
 toolbar_get_orientation (GtkToolShell *shell)
 {
diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h
index e4505bc..1b56716 100644
--- a/gtk/gtktoolbar.h
+++ b/gtk/gtktoolbar.h
@@ -114,14 +114,6 @@ GDK_AVAILABLE_IN_ALL
 void            gtk_toolbar_unset_style             (GtkToolbar      *toolbar);
 
 GDK_AVAILABLE_IN_ALL
-GtkIconSize     gtk_toolbar_get_icon_size           (GtkToolbar      *toolbar);
-GDK_AVAILABLE_IN_ALL
-void            gtk_toolbar_set_icon_size           (GtkToolbar      *toolbar,
-                                                     GtkIconSize      icon_size);
-GDK_AVAILABLE_IN_ALL
-void            gtk_toolbar_unset_icon_size         (GtkToolbar      *toolbar);
-
-GDK_AVAILABLE_IN_ALL
 gint            gtk_toolbar_get_drop_index          (GtkToolbar      *toolbar,
                                                     gint             x,
                                                     gint             y);
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 594d6af..ab6a43a 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -312,7 +312,6 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
   GtkToolbarStyle style;
   gboolean need_label = FALSE;
   gboolean need_icon = FALSE;
-  GtkIconSize icon_size;
   GtkWidget *box = NULL;
   GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
   GtkSizeGroup *size_group = NULL;
@@ -454,7 +453,6 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
         }
     }
 
-  icon_size = gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (button));
   if (need_icon)
     {
       if (button->priv->icon_widget)
@@ -464,13 +462,13 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
          if (GTK_IS_IMAGE (icon))
            {
              g_object_set (button->priv->icon_widget,
-                           "icon-size", icon_size,
+                           "icon-size", GTK_ICON_SIZE_SMALL_TOOLBAR,
                            NULL);
            }
        }
       else if (button->priv->icon_name)
        {
-         icon = gtk_image_new_from_icon_name (button->priv->icon_name, icon_size);
+         icon = gtk_image_new_from_icon_name (button->priv->icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR);
          gtk_widget_show (icon);
        }
 
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index e7a8a8b..f7cde41 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -473,33 +473,6 @@ gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item)
 }
 
 /**
- * gtk_tool_item_get_icon_size:
- * @tool_item: a #GtkToolItem
- * 
- * Returns the icon size used for @tool_item. Custom subclasses of
- * #GtkToolItem should call this function to find out what size icons
- * they should use.
- * 
- * Returns: (type int): a #GtkIconSize indicating the icon size
- * used for @tool_item
- * 
- * Since: 2.4
- **/
-GtkIconSize
-gtk_tool_item_get_icon_size (GtkToolItem *tool_item)
-{
-  GtkWidget *parent;
-
-  g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ICON_SIZE_LARGE_TOOLBAR);
-
-  parent = gtk_widget_get_parent (GTK_WIDGET (tool_item));
-  if (!parent || !GTK_IS_TOOL_SHELL (parent))
-    return GTK_ICON_SIZE_LARGE_TOOLBAR;
-
-  return gtk_tool_shell_get_icon_size (GTK_TOOL_SHELL (parent));
-}
-
-/**
  * gtk_tool_item_get_orientation:
  * @tool_item: a #GtkToolItem 
  * 
diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h
index 9a24c88..85c6651 100644
--- a/gtk/gtktoolitem.h
+++ b/gtk/gtktoolitem.h
@@ -127,8 +127,6 @@ void            gtk_tool_item_set_is_important         (GtkToolItem *tool_item,
 GDK_AVAILABLE_IN_ALL
 PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode    (GtkToolItem *tool_item);
 GDK_AVAILABLE_IN_ALL
-GtkIconSize     gtk_tool_item_get_icon_size            (GtkToolItem *tool_item);
-GDK_AVAILABLE_IN_ALL
 GtkOrientation  gtk_tool_item_get_orientation          (GtkToolItem *tool_item);
 GDK_AVAILABLE_IN_ALL
 GtkToolbarStyle gtk_tool_item_get_toolbar_style        (GtkToolItem *tool_item);
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index ffdcd9a..afbec55 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -150,17 +150,6 @@ gtk_tool_item_group_get_style (GtkToolShell *shell)
   return GTK_TOOLBAR_ICONS;
 }
 
-static GtkIconSize
-gtk_tool_item_group_get_icon_size (GtkToolShell *shell)
-{
-  GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (shell));
-
-  if (GTK_IS_TOOL_PALETTE (parent))
-    return gtk_tool_palette_get_icon_size (GTK_TOOL_PALETTE (parent));
-
-  return GTK_ICON_SIZE_SMALL_TOOLBAR;
-}
-
 static PangoEllipsizeMode
 gtk_tool_item_group_get_ellipsize_mode (GtkToolShell *shell)
 {
@@ -260,7 +249,6 @@ gtk_tool_item_group_screen_changed (GtkWidget *widget,
 static void
 gtk_tool_item_group_tool_shell_init (GtkToolShellIface *iface)
 {
-  iface->get_icon_size = gtk_tool_item_group_get_icon_size;
   iface->get_orientation = gtk_tool_item_group_get_orientation;
   iface->get_style = gtk_tool_item_group_get_style;
   iface->get_text_alignment = gtk_tool_item_group_get_text_alignment;
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index a121083..7e67c79 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -31,7 +31,6 @@
 #include "gtkorientableprivate.h"
 #include "gtkintl.h"
 
-#define DEFAULT_ICON_SIZE       GTK_ICON_SIZE_SMALL_TOOLBAR
 #define DEFAULT_ORIENTATION     GTK_ORIENTATION_VERTICAL
 #define DEFAULT_TOOLBAR_STYLE   GTK_TOOLBAR_ICONS
 
@@ -122,8 +121,6 @@ typedef struct _GtkToolPaletteDragData GtkToolPaletteDragData;
 enum
 {
   PROP_NONE,
-  PROP_ICON_SIZE,
-  PROP_ICON_SIZE_SET,
   PROP_ORIENTATION,
   PROP_TOOLBAR_STYLE,
   PROP_HADJUSTMENT,
@@ -156,8 +153,6 @@ struct _GtkToolPalettePrivate
   GtkAdjustment        *hadjustment;
   GtkAdjustment        *vadjustment;
 
-  GtkIconSize           icon_size;
-  gboolean              icon_size_set;
   GtkOrientation        orientation;
   GtkToolbarStyle       style;
   gboolean              style_set;
@@ -209,8 +204,6 @@ gtk_tool_palette_init (GtkToolPalette *palette)
   palette->priv->groups = g_ptr_array_sized_new (4);
   g_ptr_array_set_free_func (palette->priv->groups, g_free);
 
-  palette->priv->icon_size = DEFAULT_ICON_SIZE;
-  palette->priv->icon_size_set = FALSE;
   palette->priv->orientation = DEFAULT_ORIENTATION;
   palette->priv->style = DEFAULT_TOOLBAR_STYLE;
   palette->priv->style_set = FALSE;
@@ -251,24 +244,6 @@ gtk_tool_palette_set_property (GObject      *object,
 
   switch (prop_id)
     {
-      case PROP_ICON_SIZE:
-        if (palette->priv->icon_size != g_value_get_enum (value))
-          {
-            palette->priv->icon_size = g_value_get_enum (value);
-            gtk_tool_palette_reconfigured (palette);
-            g_object_notify_by_pspec (object, pspec);
-          }
-        break;
-
-      case PROP_ICON_SIZE_SET:
-        if (palette->priv->icon_size_set != g_value_get_boolean (value))
-          {
-            palette->priv->icon_size_set = g_value_get_boolean (value);
-            gtk_tool_palette_reconfigured (palette);
-            g_object_notify_by_pspec (object, pspec);
-          }
-        break;
-
       case PROP_ORIENTATION:
         if (palette->priv->orientation != g_value_get_enum (value))
           {
@@ -330,14 +305,6 @@ gtk_tool_palette_get_property (GObject    *object,
 
   switch (prop_id)
     {
-      case PROP_ICON_SIZE:
-        g_value_set_enum (value, gtk_tool_palette_get_icon_size (palette));
-        break;
-
-      case PROP_ICON_SIZE_SET:
-        g_value_set_boolean (value, palette->priv->icon_size_set);
-        break;
-
       case PROP_ORIENTATION:
         g_value_set_enum (value, palette->priv->orientation);
         break;
@@ -920,42 +887,6 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
   g_object_class_override_property (oclass, PROP_VSCROLL_POLICY, "vscroll-policy");
 
   /**
-   * GtkToolPalette:icon-size:
-   *
-   * The size of the icons in a tool palette. When this property is set,
-   * it overrides the default setting.
-   *
-   * This should only be used for special-purpose tool palettes, normal
-   * application tool palettes should respect the user preferences for the
-   * size of icons.
-   *
-   * Since: 2.20
-   */
-  g_object_class_install_property (oclass,
-                                   PROP_ICON_SIZE,
-                                   g_param_spec_enum ("icon-size",
-                                                      P_("Icon size"),
-                                                      P_("Size of icons in this tool palette"),
-                                                      GTK_TYPE_ICON_SIZE,
-                                                      DEFAULT_ICON_SIZE,
-                                                      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  /**
-   * GtkToolPalette:icon-size-set:
-   *
-   * Is %TRUE if the #GtkToolPalette:icon-size property has been set.
-   *
-   * Since: 2.20
-   */
-  g_object_class_install_property (oclass,
-                                   PROP_ICON_SIZE_SET,
-                                   g_param_spec_boolean ("icon-size-set",
-                                                         P_("Icon size set"),
-                                                         P_("Whether the icon-size property has been set"),
-                                                         FALSE,
-                                                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  /**
    * GtkToolPalette:toolbar-style:
    *
    * The style of items in the tool palette.
@@ -1019,76 +950,6 @@ gtk_tool_palette_new (void)
   return g_object_new (GTK_TYPE_TOOL_PALETTE, NULL);
 }
 
-/**
- * gtk_tool_palette_set_icon_size:
- * @palette: a #GtkToolPalette
- * @icon_size: (type int): the #GtkIconSize that icons in the tool
- *     palette shall have
- *
- * Sets the size of icons in the tool palette.
- *
- * Since: 2.20
- */
-void
-gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
-                                GtkIconSize     icon_size)
-{
-  GtkToolPalettePrivate *priv;
-
-  g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
-  g_return_if_fail (icon_size != GTK_ICON_SIZE_INVALID);
-
-  priv = palette->priv;
-
-  if (!priv->icon_size_set)
-    {
-      priv->icon_size_set = TRUE;
-      g_object_notify (G_OBJECT (palette), "icon-size-set");
-    }
-
-  if (priv->icon_size == icon_size)
-    return;
-
-  priv->icon_size = icon_size;
-  g_object_notify (G_OBJECT (palette), "icon-size");
-
-  gtk_tool_palette_reconfigured (palette);
-
-  gtk_widget_queue_resize (GTK_WIDGET (palette));
-}
-
-/**
- * gtk_tool_palette_unset_icon_size:
- * @palette: a #GtkToolPalette
- *
- * Unsets the tool palette icon size set with gtk_tool_palette_set_icon_size(),
- * so that user preferences will be used to determine the icon size.
- *
- * Since: 2.20
- */
-void
-gtk_tool_palette_unset_icon_size (GtkToolPalette *palette)
-{
-  GtkToolPalettePrivate* priv = palette->priv;
-  GtkIconSize size;
-
-  g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
-
-  if (palette->priv->icon_size_set)
-    {
-      size = DEFAULT_ICON_SIZE;
-
-      if (size != palette->priv->icon_size)
-      {
-        gtk_tool_palette_set_icon_size (palette, size);
-        g_object_notify (G_OBJECT (palette), "icon-size");
-      }
-
-      priv->icon_size_set = FALSE;
-      g_object_notify (G_OBJECT (palette), "icon-size-set");
-    }
-}
-
 /* Set the "toolbar-style" property and do appropriate things.
  * GtkToolbar does this by emitting a signal instead of just
  * calling a function...
@@ -1160,25 +1021,6 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
 }
 
 /**
- * gtk_tool_palette_get_icon_size:
- * @palette: a #GtkToolPalette
- *
- * Gets the size of icons in the tool palette.
- * See gtk_tool_palette_set_icon_size().
- *
- * Returns: (type int): the #GtkIconSize of icons in the tool palette
- *
- * Since: 2.20
- */
-GtkIconSize
-gtk_tool_palette_get_icon_size (GtkToolPalette *palette)
-{
-  g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_ICON_SIZE);
-
-  return palette->priv->icon_size;
-}
-
-/**
  * gtk_tool_palette_get_style:
  * @palette: a #GtkToolPalette
  *
diff --git a/gtk/gtktoolpalette.h b/gtk/gtktoolpalette.h
index 22f974b..d803dd3 100644
--- a/gtk/gtktoolpalette.h
+++ b/gtk/gtktoolpalette.h
@@ -113,19 +113,12 @@ gboolean                       gtk_tool_palette_get_expand            (GtkToolPa
                                                                        GtkToolItemGroup          *group);
 
 GDK_AVAILABLE_IN_ALL
-void                           gtk_tool_palette_set_icon_size         (GtkToolPalette            *palette,
-                                                                       GtkIconSize                icon_size);
-GDK_AVAILABLE_IN_ALL
-void                           gtk_tool_palette_unset_icon_size       (GtkToolPalette            *palette);
-GDK_AVAILABLE_IN_ALL
 void                           gtk_tool_palette_set_style             (GtkToolPalette            *palette,
                                                                        GtkToolbarStyle            style);
 GDK_AVAILABLE_IN_ALL
 void                           gtk_tool_palette_unset_style           (GtkToolPalette            *palette);
 
 GDK_AVAILABLE_IN_ALL
-GtkIconSize                    gtk_tool_palette_get_icon_size         (GtkToolPalette            *palette);
-GDK_AVAILABLE_IN_ALL
 GtkToolbarStyle                gtk_tool_palette_get_style             (GtkToolPalette            *palette);
 
 GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtktoolshell.c b/gtk/gtktoolshell.c
index 104aa6c..caa75d1 100644
--- a/gtk/gtktoolshell.c
+++ b/gtk/gtktoolshell.c
@@ -76,23 +76,6 @@ gtk_tool_shell_real_get_ellipsize_mode (GtkToolShell *shell)
 
 
 /**
- * gtk_tool_shell_get_icon_size:
- * @shell: a #GtkToolShell
- *
- * Retrieves the icon size for the tool shell. Tool items must not call this
- * function directly, but rely on gtk_tool_item_get_icon_size() instead.
- *
- * Returns: (type int): the current size (#GtkIconSize) for icons of @shell
- *
- * Since: 2.14
- **/
-GtkIconSize
-gtk_tool_shell_get_icon_size (GtkToolShell *shell)
-{
-  return GTK_TOOL_SHELL_GET_IFACE (shell)->get_icon_size (shell);
-}
-
-/**
  * gtk_tool_shell_get_orientation:
  * @shell: a #GtkToolShell
  *
diff --git a/gtk/gtktoolshell.h b/gtk/gtktoolshell.h
index 561a77a..4103481 100644
--- a/gtk/gtktoolshell.h
+++ b/gtk/gtktoolshell.h
@@ -43,7 +43,6 @@ typedef struct _GtkToolShellIface      GtkToolShellIface;
 
 /**
  * GtkToolShellIface:
- * @get_icon_size:        mandatory implementation of gtk_tool_shell_get_icon_size().
  * @get_orientation:      mandatory implementation of gtk_tool_shell_get_orientation().
  * @get_style:            mandatory implementation of gtk_tool_shell_get_style().
  * @rebuild_menu:         optional implementation of gtk_tool_shell_rebuild_menu().
@@ -60,7 +59,6 @@ struct _GtkToolShellIface
   GTypeInterface g_iface;
 
   /*< public >*/
-  GtkIconSize        (*get_icon_size)        (GtkToolShell *shell);
   GtkOrientation     (*get_orientation)      (GtkToolShell *shell);
   GtkToolbarStyle    (*get_style)            (GtkToolShell *shell);
   void               (*rebuild_menu)         (GtkToolShell *shell);
@@ -74,8 +72,6 @@ GDK_AVAILABLE_IN_ALL
 GType              gtk_tool_shell_get_type             (void) G_GNUC_CONST;
 
 GDK_AVAILABLE_IN_ALL
-GtkIconSize        gtk_tool_shell_get_icon_size        (GtkToolShell *shell);
-GDK_AVAILABLE_IN_ALL
 GtkOrientation     gtk_tool_shell_get_orientation      (GtkToolShell *shell);
 GDK_AVAILABLE_IN_ALL
 GtkToolbarStyle    gtk_tool_shell_get_style            (GtkToolShell *shell);
diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c
index 116201f..15b88c7 100644
--- a/tests/testtoolbar.c
+++ b/tests/testtoolbar.c
@@ -292,44 +292,6 @@ bold_toggled (GtkToggleToolButton *button)
             gtk_toggle_tool_button_get_active (button));
 }
 
-static void
-set_icon_size_toggled (GtkCheckButton *button, GtkToolbar *toolbar)
-{
-  GtkWidget *option_menu;
-  int icon_size;
-  
-  option_menu = g_object_get_data (G_OBJECT (button), "option-menu");
-
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
-    {
-      if (gtk_combo_box_get_active (GTK_COMBO_BOX (option_menu)) == 0)
-        icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR;
-      else
-        icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR;
-
-      gtk_toolbar_set_icon_size (toolbar, icon_size);
-      gtk_widget_set_sensitive (option_menu, TRUE);
-    }
-  else
-    {
-      gtk_toolbar_unset_icon_size (toolbar);
-      gtk_widget_set_sensitive (option_menu, FALSE);
-    }
-}
-
-static void
-icon_size_history_changed (GtkComboBox *menu, GtkToolbar *toolbar)
-{
-  int icon_size;
-
-  if (gtk_combo_box_get_active (menu) == 0)
-    icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR;
-  else
-    icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR;
-
-  gtk_toolbar_set_icon_size (toolbar, icon_size);
-}
-
 static gboolean
 toolbar_drag_drop (GtkWidget *widget, GdkDragContext *context,
                   gint x, gint y, guint time, GtkWidget *label)
@@ -535,20 +497,6 @@ main (gint argc, gchar **argv)
   g_signal_connect (option_menu, "changed",
                    G_CALLBACK (change_toolbar_style), toolbar);
 
-  checkbox = gtk_check_button_new_with_mnemonic("_Set Icon Size:");
-  g_signal_connect (checkbox, "toggled", G_CALLBACK (set_icon_size_toggled), toolbar);
-  gtk_box_pack_start (GTK_BOX (hbox2), checkbox, FALSE, FALSE);
-
-  option_menu = gtk_combo_box_text_new ();
-  g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu);
-  gtk_widget_set_sensitive (option_menu, FALSE);
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), "small toolbar");
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), "large toolbar");
-
-  gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE);
-  g_signal_connect (option_menu, "changed",
-                   G_CALLBACK (icon_size_history_changed), toolbar);
-
   scrolled_window = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
                                  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
diff --git a/tests/visuals/inline-toolbar-horizontal.ui b/tests/visuals/inline-toolbar-horizontal.ui
index 5421cbd..8c69dbb 100644
--- a/tests/visuals/inline-toolbar-horizontal.ui
+++ b/tests/visuals/inline-toolbar-horizontal.ui
@@ -13,7 +13,6 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="hexpand">True</property>
-            <property name="icon_size">1</property>
             <style>
               <class name="inline-toolbar"/>
             </style>
diff --git a/tests/visuals/inline-toolbar-vertical.ui b/tests/visuals/inline-toolbar-vertical.ui
index df7e699..f009cce 100644
--- a/tests/visuals/inline-toolbar-vertical.ui
+++ b/tests/visuals/inline-toolbar-vertical.ui
@@ -14,7 +14,6 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="vexpand">True</property>
-            <property name="icon_size">1</property>
             <property name="orientation">vertical</property>
             <property name="toolbar-style">icons</property>
             <style>
diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c
index 9a923e7..c8e6285 100644
--- a/testsuite/gtk/object.c
+++ b/testsuite/gtk/object.c
@@ -78,7 +78,6 @@ list_ignore_properties (gboolean buglist)
     { "GtkMenuItem",            "accel-path",           (void*) MATCH_ANY_VALUE },      /* has odd 
restrictions in the setter */
     { "GtkRecentChooserMenu",   "select-multiple",      (void*) MATCH_ANY_VALUE },      /* property disabled 
*/
     { "GtkTextView",            "overwrite",            (void*) MATCH_ANY_VALUE },      /* needs text buffer 
*/
-    { "GtkToolbar",             "icon-size",            (void*) GTK_ICON_SIZE_INVALID },
     { "GtkTreeView",            "expander-column",      (void*) MATCH_ANY_VALUE },      /* assertion list != 
NULL */
     { "GtkWindow",              "screen",               (void*) MATCH_ANY_VALUE },      /* cannot create 
GdkScreen */
     { NULL, NULL, NULL }


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