aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-15 22:24:35 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-15 22:24:35 +0800
commit217f693f5762bbc4f327542dd911a639c42dc8bd (patch)
treedd98c3faee831e878b6818c28b0c1d0037fc8b29 /lib
parentb97ce595da599035a5b3e38997eace8c2b416060 (diff)
downloadgsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar.gz
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar.bz2
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar.lz
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar.xz
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.tar.zst
gsoc2013-epiphany-217f693f5762bbc4f327542dd911a639c42dc8bd.zip
Update, fix remove toolbar regressions.
2003-04-15 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-editable-toolbar.c: * lib/egg/eggmarshalers.list: * lib/egg/eggtoggletoolbutton.c: * lib/egg/eggtoolbar.c: * lib/egg/eggtoolbar.h: Update, fix remove toolbar regressions.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/egg/egg-editable-toolbar.c111
-rw-r--r--lib/egg/eggmarshalers.list2
-rw-r--r--lib/egg/eggtoggletoolbutton.c52
-rw-r--r--lib/egg/eggtoolbar.c268
-rw-r--r--lib/egg/eggtoolbar.h4
5 files changed, 211 insertions, 226 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index f53910ac5..31122be46 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -61,19 +61,6 @@ static void egg_editable_toolbar_remove_cb (EggAction *action,
static void egg_editable_toolbar_edit_cb (EggAction *action,
EggEditableToolbar *etoolbar);
-static EggActionGroupEntry egg_toolbar_popups[] = {
- /* Toplevel */
- {"FakeToplevel", (""), NULL, NULL, NULL, NULL, NULL},
-
- /* Popups */
- {"RemoveToolbarPopup", N_("_Remove Toolbar"), GTK_STOCK_REMOVE, NULL,
- NULL, G_CALLBACK (egg_editable_toolbar_remove_cb), NULL},
- {"EditToolbarPopup", N_("_Edit Toolbars..."), GTK_STOCK_PREFERENCES, NULL,
- NULL, G_CALLBACK (egg_editable_toolbar_edit_cb), NULL},
-};
-
-static guint egg_toolbar_popups_n_entries = G_N_ELEMENTS (egg_toolbar_popups);
-
enum
{
PROP_0,
@@ -101,9 +88,6 @@ struct EggEditableToolbarPrivate
EggToolbarsGroup *group;
- EggMenuMerge *popup_merge;
- EggActionGroup *popup_action_group;
-
GList *actions_list;
GList *drag_types;
@@ -142,20 +126,6 @@ egg_editable_toolbar_get_type (void)
return egg_editable_toolbar_type;
}
-static void
-update_popup_menu (EggEditableToolbar *t)
-{
- EggAction *action;
-
- action = egg_action_group_get_action (t->priv->popup_action_group,
- "EditToolbarPopup");
- g_object_set (G_OBJECT (action), "visible", !t->priv->edit_mode, NULL);
-
- action = egg_action_group_get_action (t->priv->popup_action_group,
- "RemoveToolbarPopup");
- g_object_set (G_OBJECT (action), "visible", t->priv->edit_mode, NULL);
-}
-
static EggAction *
find_action (EggEditableToolbar *t,
const char *name)
@@ -502,6 +472,10 @@ connect_toolbar_drag_source (EggToolbarsToolbar *t,
g_object_set_data (G_OBJECT (tb), "toolbar_drag_data", t);
+ gtk_drag_source_set (tb, GDK_BUTTON1_MASK,
+ source_drag_types, n_source_drag_types,
+ GDK_ACTION_MOVE);
+
g_signal_connect (tb, "drag_data_get",
G_CALLBACK (toolbar_drag_data_get_cb), etoolbar);
g_signal_connect (tb, "drag_data_delete",
@@ -527,6 +501,8 @@ disconnect_toolbar_drag_source (EggToolbarsToolbar *t,
g_object_set_data (G_OBJECT (tb), "drag_source_set",
GINT_TO_POINTER (FALSE));
+ gtk_drag_source_unset (tb);
+
g_signal_handlers_disconnect_by_func (tb,
G_CALLBACK
(toolbar_drag_data_get_cb),
@@ -542,16 +518,40 @@ static void
popup_toolbar_context_menu (EggToolbar *toolbar,
ContextMenuData *data)
{
- GtkWidget *widget;
-
- widget = egg_menu_merge_get_widget (data->etoolbar->priv->popup_merge,
- "/popups/EggToolbarPopup");
-
- g_object_set_data (G_OBJECT (data->etoolbar), "popup_toolbar", data->t);
-
- g_return_if_fail (widget != NULL);
-
- gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
+ GtkWidget *menu;
+ GtkWidget *item;
+ GtkWidget *image;
+ EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR (data->etoolbar);
+
+ menu = gtk_menu_new ();
+
+ if (etoolbar->priv->edit_mode)
+ {
+ item = gtk_image_menu_item_new_with_mnemonic (_("_Remove Toolbar"));
+ gtk_widget_show (item);
+ image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_object_set_data (G_OBJECT (etoolbar), "popup_toolbar", data->t);
+ g_signal_connect (item, "activate",
+ G_CALLBACK (egg_editable_toolbar_remove_cb),
+ etoolbar);
+ }
+ else
+ {
+ item = gtk_image_menu_item_new_with_mnemonic (_("_Edit Toolbars..."));
+ gtk_widget_show (item);
+ image = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_signal_connect (item, "activate",
+ G_CALLBACK (egg_editable_toolbar_edit_cb),
+ etoolbar);
+ }
+
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 2,
gtk_get_current_event_time ());
}
@@ -814,8 +814,6 @@ egg_editable_toolbar_class_init (EggEditableToolbarClass *klass)
static void
egg_editable_toolbar_init (EggEditableToolbar *t)
{
- int i;
-
t->priv = g_new0 (EggEditableToolbarPrivate, 1);
t->priv->merge = NULL;
@@ -828,26 +826,6 @@ egg_editable_toolbar_init (EggEditableToolbar *t)
t->priv->drag_types = NULL;
egg_editable_toolbar_add_drag_type (t, EGG_TOOLBAR_ITEM_TYPE);
-
- for (i = 0; i < egg_toolbar_popups_n_entries; i++)
- {
- egg_toolbar_popups[i].user_data = t;
- }
-
- t->priv->popup_merge = egg_menu_merge_new ();
-
- t->priv->popup_action_group = egg_action_group_new ("ToolbarPopupActions");
- egg_action_group_add_actions (t->priv->popup_action_group,
- egg_toolbar_popups,
- egg_toolbar_popups_n_entries);
- egg_menu_merge_insert_action_group (t->priv->popup_merge,
- t->priv->popup_action_group, 0);
-/* FIXME
- egg_menu_merge_add_ui_from_file (t->priv->popup_merge,
- egg_file ("epiphany-toolbar-popup-ui.xml"),
- NULL);
-*/
- update_popup_menu (t);
}
static void
@@ -869,11 +847,6 @@ egg_editable_toolbar_finalize (GObject *object)
g_list_free (t->priv->drag_types);
}
- g_object_unref (t->priv->popup_action_group);
- egg_menu_merge_remove_action_group (t->priv->popup_merge,
- t->priv->popup_action_group);
- g_object_unref (t->priv->popup_merge);
-
g_free (t->priv);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -942,8 +915,6 @@ editor_close (EggEditableToolbar * etoolbar)
(EggToolbarsGroupForeachToolbarFunc)
disconnect_toolbar_drag_source,
etoolbar);
-
- update_popup_menu (etoolbar);
hide_editor (etoolbar);
}
@@ -1187,8 +1158,6 @@ egg_editable_toolbar_edit (EggEditableToolbar *etoolbar,
(EggToolbarsGroupForeachToolbarFunc)
connect_toolbar_drag_source, etoolbar);
- update_popup_menu (etoolbar);
-
setup_editor (etoolbar, window);
show_editor (etoolbar);
}
diff --git a/lib/egg/eggmarshalers.list b/lib/egg/eggmarshalers.list
index d1652d501..1baf284ec 100644
--- a/lib/egg/eggmarshalers.list
+++ b/lib/egg/eggmarshalers.list
@@ -2,6 +2,8 @@ VOID:OBJECT,OBJECT
VOID:OBJECT,STRING,LONG,LONG
VOID:OBJECT,LONG
VOID:OBJECT,STRING,STRING
+VOID:UINT,UINT
+BOOLEAN:INT
BOOLEAN:ENUM
BOOLEAN:VOID
OBJECT:VOID
diff --git a/lib/egg/eggtoggletoolbutton.c b/lib/egg/eggtoggletoolbutton.c
index 23fbff2a5..b1ac63f05 100644
--- a/lib/egg/eggtoggletoolbutton.c
+++ b/lib/egg/eggtoggletoolbutton.c
@@ -39,11 +39,10 @@ static void egg_toggle_tool_button_finalize (GObject *object)
static GtkWidget *egg_toggle_tool_button_create_menu_proxy (EggToolItem *button);
-
-static void button_toggled (GtkWidget *widget,
- EggToggleToolButton *button);
-
-
+static void button_toggled (GtkWidget *widget,
+ EggToggleToolButton *button);
+static void menu_item_activated (GtkWidget *widget,
+ EggToggleToolButton *button);
static GObjectClass *parent_class = NULL;
static guint toggle_signals[LAST_SIGNAL] = { 0 };
@@ -137,9 +136,8 @@ egg_toggle_tool_button_create_menu_proxy (EggToolItem *item)
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button->menu_item),
button->active);
g_signal_connect_object (button->menu_item, "activate",
- G_CALLBACK (gtk_button_clicked),
- EGG_TOOL_BUTTON (button)->button,
- G_CONNECT_SWAPPED);
+ G_CALLBACK (menu_item_activated),
+ EGG_TOOL_BUTTON (button), 0);
g_object_add_weak_pointer (G_OBJECT (button->menu_item),
(gpointer *)&(button->menu_item));
@@ -148,22 +146,40 @@ egg_toggle_tool_button_create_menu_proxy (EggToolItem *item)
}
static void
-button_toggled (GtkWidget *widget,
- EggToggleToolButton *button)
+menu_item_activated (GtkWidget *menu_item,
+ EggToggleToolButton *toggle_tool_button)
{
- gboolean toggle_active;
+ EggToolButton *tool_button = EGG_TOOL_BUTTON (toggle_tool_button);
+ gboolean menu_active = GTK_CHECK_MENU_ITEM (menu_item)->active;
- toggle_active = GTK_TOGGLE_BUTTON (widget)->active;
- if (toggle_active != button->active)
+ if (toggle_tool_button->active != menu_active)
{
- button->active = toggle_active;
- g_signal_emit (G_OBJECT (button), toggle_signals[TOGGLED], 0);
+ toggle_tool_button->active = menu_active;
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tool_button->button),
+ toggle_tool_button->active);
+
+ g_signal_emit (G_OBJECT (toggle_tool_button), toggle_signals[TOGGLED], 0);
}
+}
- if (button->menu_item)
+static void
+button_toggled (GtkWidget *widget,
+ EggToggleToolButton *toggle_tool_button)
+{
+ gboolean toggle_active = GTK_TOGGLE_BUTTON (widget)->active;
+
+ if (toggle_tool_button->active != toggle_active)
{
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button->menu_item),
- button->active);
+ toggle_tool_button->active = toggle_active;
+
+ if (toggle_tool_button->menu_item)
+ {
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toggle_tool_button->menu_item),
+ toggle_tool_button->active);
+ }
+
+ g_signal_emit (G_OBJECT (toggle_tool_button), toggle_signals[TOGGLED], 0);
}
}
diff --git a/lib/egg/eggtoolbar.c b/lib/egg/eggtoolbar.c
index b4cdbc62e..d88e7b429 100644
--- a/lib/egg/eggtoolbar.c
+++ b/lib/egg/eggtoolbar.c
@@ -174,8 +174,8 @@ typedef struct
GList *items;
GList *first_non_fitting_item;
- gint total_button_maxw;
- gint total_button_maxh;
+ gint max_child_width;
+ gint max_child_height;
GtkWidget *button;
GtkWidget *arrow;
@@ -695,155 +695,123 @@ egg_toolbar_size_request (GtkWidget *widget,
{
EggToolbar *toolbar = EGG_TOOLBAR (widget);
EggToolbarPrivate *priv = EGG_TOOLBAR_GET_PRIVATE (toolbar);
- GList *items;
- gint nbuttons, ipadding;
- gint button_maxw, button_maxh;
- gint total_button_maxw, total_button_maxh;
- gint space_size;
- GtkRequisition child_requisition;
-
- requisition->width = GTK_CONTAINER (toolbar)->border_width * 2;
- requisition->height = GTK_CONTAINER (toolbar)->border_width * 2;
- nbuttons = 0;
- button_maxw = 0;
- button_maxh = 0;
- total_button_maxw = 0;
- total_button_maxh = 0;
- items = priv->items;
- space_size = get_space_size (toolbar);
-
- if (priv->show_arrow)
+ gint space_size = get_space_size (toolbar);
+ GList *list;
+ gint max_child_height;
+ gint max_child_width;
+ gint max_homogeneous_child_width;
+ gint max_homogeneous_child_height;
+ gint homogeneous_size;
+ gint long_req;
+ gint pack_end_size;
+ gint pack_front_size;
+ gint ipadding;
+ GtkRequisition arrow_requisition;
+
+ max_homogeneous_child_width = 0;
+ max_homogeneous_child_height = 0;
+ max_child_width = 0;
+ max_child_height = 0;
+ for (list = priv->items; list != NULL; list = list->next)
{
- /* When we enable the arrow we only want to be the
- * size of the arrows plus the size of any items that
- * are pack-end.
- */
-
- items = priv->items;
-
- while (items)
+ EggToolItem *item = list->data;
+
+ GtkRequisition requisition;
+
+ gtk_widget_size_request (GTK_WIDGET (item), &requisition);
+
+ max_child_width = MAX (max_child_width, requisition.width);
+ max_child_height = MAX (max_child_height, requisition.height);
+
+ if (TOOLBAR_ITEM_VISIBLE (item) && EGG_TOOL_ITEM (item)->homogeneous)
{
- EggToolItem *item = EGG_TOOL_ITEM (items->data);
-
- if (TOOLBAR_ITEM_VISIBLE (item))
- {
- gtk_widget_size_request (GTK_WIDGET (item), &child_requisition);
-
- total_button_maxw = MAX (total_button_maxw, child_requisition.width);
- total_button_maxh = MAX (total_button_maxh, child_requisition.height);
-
- if (item->homogeneous)
- {
- if (item->pack_end)
- nbuttons++;
- button_maxw = MAX (button_maxw, child_requisition.width);
- button_maxh = MAX (button_maxh, child_requisition.height);
- }
- else if (item->pack_end)
- {
- if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
- requisition->width += child_requisition.width;
- else
- requisition->height += child_requisition.height;
- }
- if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
- requisition->height = MAX (requisition->height, child_requisition.height);
- else
- requisition->width = MAX (requisition->width, child_requisition.width);
- }
-
- items = items->next;
+ max_homogeneous_child_width = MAX (max_homogeneous_child_width, requisition.width);
+ max_homogeneous_child_height = MAX (max_homogeneous_child_height, requisition.height);
}
-
- /* Add the arrow */
- gtk_widget_size_request (priv->button, &child_requisition);
+ }
+
+ if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+ homogeneous_size = max_homogeneous_child_width;
+ else
+ homogeneous_size = max_homogeneous_child_height;
+
+ pack_end_size = 0;
+ pack_front_size = 0;
+ for (list = priv->items; list != NULL; list = list->next)
+ {
+ EggToolItem *item = list->data;
+ guint size;
- if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (!TOOLBAR_ITEM_VISIBLE (item))
+ continue;
+
+ if (item->homogeneous)
{
- requisition->width += child_requisition.width;
- requisition->height = MAX (requisition->height, child_requisition.height);
+ size = homogeneous_size;
}
- else
+ else if (!GTK_BIN (item)->child)
{
- requisition->height += child_requisition.height;
- requisition->width = MAX (requisition->width, child_requisition.width);
+ size = space_size;
}
- }
- else
- {
- items = priv->items;
-
- while (items)
+ else
{
- EggToolItem *item = EGG_TOOL_ITEM (items->data);
+ GtkRequisition requisition;
- if (!TOOLBAR_ITEM_VISIBLE (item))
- {
- items = items->next;
- continue;
- }
+ gtk_widget_size_request (GTK_WIDGET (item), &requisition);
- if (!GTK_BIN (item)->child)
- {
- if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
- requisition->width += space_size;
- else
- requisition->height += space_size;
- }
+ if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+ size = requisition.width;
else
- {
- gtk_widget_size_request (GTK_WIDGET (item), &child_requisition);
-
- total_button_maxw = MAX (total_button_maxw, child_requisition.width);
- total_button_maxh = MAX (total_button_maxh, child_requisition.height);
-
- if (item->homogeneous)
- {
- nbuttons++;
- button_maxw = MAX (button_maxw, child_requisition.width);
- button_maxh = MAX (button_maxh, child_requisition.height);
- }
- else
- {
- if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- requisition->width += child_requisition.width;
- requisition->height = MAX (requisition->height, child_requisition.height);
- }
- else
- {
- requisition->height += child_requisition.height;
- requisition->width = MAX (requisition->width, child_requisition.width);
- }
- }
- }
-
- items = items->next;
+ size = requisition.height;
}
+
+ if (item->pack_end)
+ pack_end_size += size;
+ else
+ pack_front_size += size;
+ }
+
+ long_req = pack_end_size;
+
+ if (priv->show_arrow)
+ {
+ gtk_widget_size_request (priv->button, &arrow_requisition);
+
+ if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+ long_req = pack_end_size + MIN (max_child_width, arrow_requisition.width);
+ else
+ long_req = pack_end_size + MIN (max_child_height, arrow_requisition.height);
+ }
+ else
+ {
+ arrow_requisition.height = 0;
+ arrow_requisition.width = 0;
+
+ long_req = pack_end_size + pack_front_size;
}
if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
{
- requisition->width += nbuttons * button_maxw;
- requisition->height = MAX (requisition->height, button_maxh);
+ requisition->width = long_req;
+ requisition->height = MAX (max_child_height, arrow_requisition.height);
}
else
{
- requisition->width = MAX (requisition->width, button_maxw);
- requisition->height += nbuttons * button_maxh;
+ requisition->height = long_req;
+ requisition->width = MAX (max_child_width, arrow_requisition.width);
}
-
+
/* Extra spacing */
gtk_widget_style_get (widget, "internal_padding", &ipadding, NULL);
requisition->width += 2 * ipadding;
requisition->height += 2 * ipadding;
-
- priv->total_button_maxw = total_button_maxw;
- priv->total_button_maxh = total_button_maxh;
- toolbar->button_maxw = button_maxw;
- toolbar->button_maxh = button_maxh;
+ priv->max_child_width = max_child_width;
+ priv->max_child_height = max_child_height;
+
+ toolbar->button_maxw = max_homogeneous_child_width;
+ toolbar->button_maxh = max_homogeneous_child_height;
}
static void
@@ -1036,7 +1004,7 @@ egg_toolbar_size_allocate (GtkWidget *widget,
available_size -= child_requisition.width;
child_allocation.width = child_requisition.width;
- child_allocation.height = priv->total_button_maxh;
+ child_allocation.height = priv->max_child_height;
child_allocation.y = (allocation->height - child_allocation.height) / 2;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = edge_position - child_allocation.width;
@@ -1049,7 +1017,7 @@ egg_toolbar_size_allocate (GtkWidget *widget,
available_size -= child_requisition.width;
child_allocation.height = child_requisition.height;
- child_allocation.width = priv->total_button_maxw;
+ child_allocation.width = priv->max_child_width;
child_allocation.x = allocation->x + (allocation->width - child_allocation.width) / 2;
child_allocation.y = edge_position - child_allocation.height;
}
@@ -1598,27 +1566,56 @@ egg_toolbar_drag_motion (GtkWidget *widget,
return TRUE;
}
-
static void
egg_toolbar_add (GtkContainer *container,
- GtkWidget *widget)
+ GtkWidget *widget)
{
+ EggToolbar *toolbar;
+
g_return_if_fail (EGG_IS_TOOLBAR (container));
- g_return_if_fail (EGG_IS_TOOL_ITEM (widget));
+ g_return_if_fail (widget != NULL);
- egg_toolbar_append (EGG_TOOLBAR (container),
- EGG_TOOL_ITEM (widget));
+ toolbar = EGG_TOOLBAR (container);
+
+ if (EGG_IS_TOOL_ITEM (widget))
+ egg_toolbar_append (toolbar, EGG_TOOL_ITEM (widget));
+ else
+ egg_toolbar_append_widget (toolbar, widget, NULL, NULL);
}
static void
egg_toolbar_remove (GtkContainer *container,
GtkWidget *widget)
{
- g_return_if_fail (EGG_IS_TOOLBAR (container));
- g_return_if_fail (EGG_IS_TOOL_ITEM (widget));
+ EggToolbar *toolbar;
+ EggToolItem *item = NULL;
- egg_toolbar_remove_tool_item (EGG_TOOLBAR (container),
- EGG_TOOL_ITEM (widget));
+ g_return_if_fail (EGG_IS_TOOLBAR (container));
+
+ toolbar = EGG_TOOLBAR (container);
+
+ if (EGG_IS_TOOL_ITEM (widget))
+ {
+ item = EGG_TOOL_ITEM (widget);
+ }
+ else
+ {
+ EggToolbarPrivate *priv = EGG_TOOLBAR_GET_PRIVATE (toolbar);
+ GList *list;
+
+ for (list = priv->items; list != NULL; list = list->next)
+ {
+ if (GTK_BIN (list->data)->child == widget)
+ {
+ item = list->data;
+ break;
+ }
+ }
+ }
+
+ g_return_if_fail (item != NULL);
+
+ egg_toolbar_remove_tool_item (EGG_TOOLBAR (container), item);
}
static void
@@ -2485,6 +2482,7 @@ egg_toolbar_internal_insert_element (EggToolbar *toolbar,
tooltip_text, tooltip_private_text);
toolbar->children = g_list_insert (toolbar->children, child, position);
+
egg_toolbar_insert (toolbar, item, position);
return child->widget;
diff --git a/lib/egg/eggtoolbar.h b/lib/egg/eggtoolbar.h
index b82f7ecf5..aa2efc056 100644
--- a/lib/egg/eggtoolbar.h
+++ b/lib/egg/eggtoolbar.h
@@ -88,8 +88,8 @@ struct _EggToolbar
GtkTooltips *tooltips;
- gint button_maxw;
- gint button_maxh;
+ gint button_maxw; /* maximum width of homogeneous children */
+ gint button_maxh; /* maximum height of homogeneous children */
guint style_set_connection;
guint icon_size_connection;