summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-10-11 09:33:12 +0200
committerBenjamin Otte <otte@redhat.com>2016-10-18 00:29:16 +0200
commit33a857decf4880ac7c4a3114a24acd97e5ef010b (patch)
treed70247c628d5e6dafc0e1c95bced8297bb3c4b8a
parentcd90b56627cbd729a5ea386123b09451f08294de (diff)
downloadgtk+-33a857decf4880ac7c4a3114a24acd97e5ef010b.tar.gz
toolbutton: Remove icon-spacing style property
-rw-r--r--gtk/gtktoolbutton.c56
1 files changed, 4 insertions, 52 deletions
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 3034b4d986..019a8e3889 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -104,7 +104,6 @@ static void gtk_tool_button_toolbar_reconfigured (GtkToolItem *tool_item);
static gboolean gtk_tool_button_create_menu_proxy (GtkToolItem *item);
static void button_clicked (GtkWidget *widget,
GtkToolButton *button);
-static void gtk_tool_button_style_updated (GtkWidget *widget);
static void gtk_tool_button_construct_contents (GtkToolItem *tool_item);
@@ -192,8 +191,6 @@ gtk_tool_button_class_init (GtkToolButtonClass *klass)
object_class->notify = gtk_tool_button_property_notify;
object_class->finalize = gtk_tool_button_finalize;
- widget_class->style_updated = gtk_tool_button_style_updated;
-
tool_item_class->create_menu_proxy = gtk_tool_button_create_menu_proxy;
tool_item_class->toolbar_reconfigured = gtk_tool_button_toolbar_reconfigured;
@@ -283,22 +280,6 @@ gtk_tool_button_class_init (GtkToolButtonClass *klass)
g_object_class_override_property (object_class, PROP_ACTION_NAME, "action-name");
g_object_class_override_property (object_class, PROP_ACTION_TARGET, "action-target");
- /**
- * GtkButton:icon-spacing:
- *
- * Spacing in pixels between the icon and label.
- *
- * Since: 2.10
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("icon-spacing",
- P_("Icon spacing"),
- P_("Spacing in pixels between the icon and label"),
- 0,
- G_MAXINT,
- 3,
- GTK_PARAM_READWRITE));
-
/**
* GtkToolButton::clicked:
* @toolbutton: the object that emitted the signal
@@ -356,17 +337,12 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
gboolean need_icon = FALSE;
GtkIconSize icon_size;
GtkWidget *box = NULL;
- guint icon_spacing;
GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
GtkSizeGroup *size_group = NULL;
GtkWidget *parent;
button->priv->contents_invalid = FALSE;
- gtk_widget_style_get (GTK_WIDGET (tool_item),
- "icon-spacing", &icon_spacing,
- NULL);
-
if (button->priv->icon_widget)
{
parent = gtk_widget_get_parent (button->priv->icon_widget);
@@ -565,9 +541,9 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
case GTK_TOOLBAR_BOTH:
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
- box = gtk_box_new (GTK_ORIENTATION_VERTICAL, icon_spacing);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
else
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, icon_spacing);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL,0);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon, TRUE, TRUE);
gtk_box_pack_end (GTK_BOX (box), label, FALSE, TRUE);
@@ -579,7 +555,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
case GTK_TOOLBAR_BOTH_HORIZ:
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
{
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, icon_spacing);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon, label? FALSE : TRUE, TRUE);
if (label)
@@ -587,7 +563,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
}
else
{
- box = gtk_box_new (GTK_ORIENTATION_VERTICAL, icon_spacing);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
if (icon)
gtk_box_pack_end (GTK_BOX (box), icon, label ? FALSE : TRUE, TRUE);
if (label)
@@ -888,30 +864,6 @@ gtk_tool_button_toolbar_reconfigured (GtkToolItem *tool_item)
}
static void
-gtk_tool_button_update_icon_spacing (GtkToolButton *button)
-{
- GtkWidget *box;
- guint spacing;
-
- box = gtk_bin_get_child (GTK_BIN (button->priv->button));
- if (GTK_IS_BOX (box))
- {
- gtk_widget_style_get (GTK_WIDGET (button),
- "icon-spacing", &spacing,
- NULL);
- gtk_box_set_spacing (GTK_BOX (box), spacing);
- }
-}
-
-static void
-gtk_tool_button_style_updated (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
-
- gtk_tool_button_update_icon_spacing (GTK_TOOL_BUTTON (widget));
-}
-
-static void
gtk_tool_button_activatable_interface_init (GtkActivatableIface *iface)
{
parent_activatable_iface = g_type_interface_peek_parent (iface);