[gtk+/wip/baedert/box: 1/65] toolbutton: Remove icon-spacing style property
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/box: 1/65] toolbutton: Remove icon-spacing style property
- Date: Mon, 17 Oct 2016 14:56:14 +0000 (UTC)
commit 5e4e81304cb92e093876815d183a1ed4c0b8f323
Author: Timm Bäder <mail baedert org>
Date: Tue Oct 11 09:33:12 2016 +0200
toolbutton: Remove icon-spacing style property
gtk/gtktoolbutton.c | 56 +++-----------------------------------------------
1 files changed, 4 insertions(+), 52 deletions(-)
---
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 3034b4d..019a8e3 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]