Add Close menu item to the notebook tab menu

This is especially useful if tab close buttons are disabled.
This commit is contained in:
Enrico Tröger 2011-11-20 16:10:02 +01:00
parent cfa334de74
commit 39606dd17c

View File

@ -246,6 +246,12 @@ static void show_tab_bar_popup_menu(GdkEventButton *event, GtkWidget *page)
gtk_widget_show(menu_item); gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item); gtk_container_add(GTK_CONTAINER(menu), menu_item);
menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLOSE, NULL);
gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item);
g_signal_connect(menu_item, "activate", G_CALLBACK(notebook_tab_close_clicked_cb), page);
gtk_widget_set_sensitive(GTK_WIDGET(menu_item), (page != NULL));
menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("Close Ot_her Documents")); menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("Close Ot_her Documents"));
gtk_widget_show(menu_item); gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item); gtk_container_add(GTK_CONTAINER(menu), menu_item);