summaryrefslogtreecommitdiff
path: root/gtk/gtkaction.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-01-28 03:16:30 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-01-28 03:16:30 +0000
commitd465fbeda745525485098815a5a702d7d6b031d7 (patch)
tree143f19f67ca1ff1ecf768e8ebd031168d584481a /gtk/gtkaction.c
parent0030448e265e50dea73a772e61f558183519fbf7 (diff)
downloadgtk+-d465fbeda745525485098815a5a702d7d6b031d7.tar.gz
Rearrange things so that setting multiple properties causes not more than
2007-01-27 Matthias Clasen <mclasen@redhat.com> * gtk/gtktoolbar.c: * gtk/gtktoolitem.c: * gtk/gtktoolbutton.c: Rearrange things so that setting multiple properties causes not more than a single reconstruction of the contents. * gtk/gtkaction.c (connect_proxy): Set all tool button properties in one go. svn path=/trunk/; revision=17227
Diffstat (limited to 'gtk/gtkaction.c')
-rw-r--r--gtk/gtkaction.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index 5307363db2..5962828406 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -739,26 +739,13 @@ connect_proxy (GtkAction *action,
}
else if (GTK_IS_TOOL_ITEM (proxy))
{
- /* toolbar item specific synchronisers ... */
-
- g_object_set (proxy,
- "visible-horizontal", action->private_data->visible_horizontal,
- "visible-vertical", action->private_data->visible_vertical,
- "is-important", action->private_data->is_important,
- NULL);
-
- gtk_action_sync_tooltip (action, proxy);
-
- g_signal_connect_object (proxy, "create_menu_proxy",
- G_CALLBACK (gtk_action_create_menu_proxy),
- action, 0);
-
- gtk_tool_item_rebuild_menu (GTK_TOOL_ITEM (proxy));
-
/* toolbar button specific synchronisers ... */
if (GTK_IS_TOOL_BUTTON (proxy))
{
g_object_set (proxy,
+ "visible-horizontal", action->private_data->visible_horizontal,
+ "visible-vertical", action->private_data->visible_vertical,
+ "is-important", action->private_data->is_important,
"label", action->private_data->short_label,
"use-underline", TRUE,
"stock-id", action->private_data->stock_id,
@@ -768,7 +755,23 @@ connect_proxy (GtkAction *action,
g_signal_connect_object (proxy, "clicked",
G_CALLBACK (gtk_action_activate), action,
G_CONNECT_SWAPPED);
- }
+ }
+ else
+ {
+ g_object_set (proxy,
+ "visible-horizontal", action->private_data->visible_horizontal,
+ "visible-vertical", action->private_data->visible_vertical,
+ "is-important", action->private_data->is_important,
+ NULL);
+ }
+
+ gtk_action_sync_tooltip (action, proxy);
+
+ g_signal_connect_object (proxy, "create_menu_proxy",
+ G_CALLBACK (gtk_action_create_menu_proxy),
+ action, 0);
+
+ gtk_tool_item_rebuild_menu (GTK_TOOL_ITEM (proxy));
}
else if (GTK_IS_BUTTON (proxy))
{