diff options
-rw-r--r-- | src/tab-label.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index a308244..fb9b4bb 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -64,6 +64,12 @@ reload_tab_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) } static void +close_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) +{ + mq_tab_page_close(tab_label->tab_page); +} + +static void new_tab_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) { mq_notebook_insert_sibling( @@ -129,6 +135,7 @@ create_tab_popover(GtkWidget *widget, MqTabLabel *tab_label) NEW_BUTTON(1, 2, "edit-undo", "Undo close tab"); CLICKED_CB(0, 0, G_CALLBACK(reload_tab_clicked_cb)); + CLICKED_CB(0, 3, G_CALLBACK(close_clicked_cb)); CLICKED_CB(1, 0, G_CALLBACK(new_tab_clicked_cb)); CLICKED_CB(1, 1, G_CALLBACK(new_window_clicked_cb)); @@ -339,6 +346,8 @@ mq_tab_label_init(MqTabLabel *tab_label) GTK_ICON_SIZE_BUTTON); gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE); gtk_widget_set_tooltip_text(close_button, "Close tab"); + g_signal_connect(close_button, "clicked", + G_CALLBACK(close_clicked_cb), tab_label); /* Pack tab box. */ box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |