diff options
author | David Bordoley <bordoley@msu.edu> | 2003-04-27 16:35:50 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-27 16:35:50 +0800 |
commit | 34c164d7175456a25362d00981d1cc38a339baf2 (patch) | |
tree | 1e2bf50d082477e4b60d859eeffb52efb9e2eb30 /lib/egg/egg-editable-toolbar.c | |
parent | 9605e12bd4a9238f989e6f1c662781b848555cac (diff) | |
download | gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar.gz gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar.bz2 gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar.lz gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar.xz gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.tar.zst gsoc2013-epiphany-34c164d7175456a25362d00981d1cc38a339baf2.zip |
Update.
2003-04-27 David Bordoley <bordoley@msu.edu>
* lib/egg/egg-editable-toolbar.c:
* lib/egg/egg-toolbar-editor.c:
* lib/egg/egg-toolbar-editor.h:
Update.
* src/window-commands.c: (toolbar_editor_help_cb),
(window_cmd_edit_toolbar):
Add and help button.
Diffstat (limited to 'lib/egg/egg-editable-toolbar.c')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index a877eb96e..ff7b78266 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -53,6 +53,7 @@ struct EggEditableToolbarPrivate EggMenuMerge *merge; EggToolbarsModel *model; gboolean edit_mode; + GtkWidget *selected_toolbar; }; GType @@ -223,12 +224,12 @@ drag_data_get_cb (GtkWidget *widget, } static void -remove_toolbar_cb (GtkWidget *toolbar, +remove_toolbar_cb (GtkWidget *menuitem, EggEditableToolbar *etoolbar) { int pos; - pos = get_toolbar_position (etoolbar, toolbar); + pos = get_toolbar_position (etoolbar, etoolbar->priv->selected_toolbar); egg_toolbars_model_remove_toolbar (etoolbar->priv->model, pos); } @@ -240,20 +241,25 @@ popup_toolbar_context_menu_cb (GtkWidget *toolbar, GtkWidget *item; GtkWidget *image; - menu = gtk_menu_new (); - - 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_signal_connect (item, "activate", - G_CALLBACK (remove_toolbar_cb), - t); - - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 2, - gtk_get_current_event_time ()); + if (t->priv->edit_mode) + { + t->priv->selected_toolbar = toolbar; + + menu = gtk_menu_new (); + + 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_signal_connect (item, "activate", + G_CALLBACK (remove_toolbar_cb), + t); + + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 2, + gtk_get_current_event_time ()); + } } static GtkWidget * |