summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-25 10:40:50 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-25 10:40:50 (EDT)
commitcd9b4544e5ce0843744f98317aca6ae34df9327e (patch)
tree291515fb9524a4cde35a3ec2b1487d7bf6ab6684
parent83b9022b6b8af9b28dfae943307ad8465e036680 (diff)
downloadmarquee-cd9b4544e5ce0843744f98317aca6ae34df9327e.zip
marquee-cd9b4544e5ce0843744f98317aca6ae34df9327e.tar.gz
marquee-cd9b4544e5ce0843744f98317aca6ae34df9327e.tar.bz2
MqTabLabel: Make close buttons effective
-rw-r--r--src/tab-label.c9
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);