diff options
-rw-r--r-- | src/tab.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -158,6 +158,7 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) static void mq_tab_populate_tab(MqTab *tab) { + GtkWidget *close_button; GtkWidget *box; tab->title = "New tab"; @@ -173,12 +174,16 @@ mq_tab_populate_tab(MqTab *tab) gtk_widget_set_hexpand(tab->tab_label, TRUE); gtk_widget_set_size_request(tab->tab_label, 50, 1); + /* Set up close button. */ + close_button = gtk_button_new_from_icon_name("window-close", + GTK_ICON_SIZE_BUTTON); + gtk_widget_set_tooltip_text(close_button, "Close tab"); + /* Pack tab box. */ box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start(GTK_BOX(box), tab->tab_image, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(box), tab->tab_label, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(box), gtk_button_new_from_icon_name( - "window-close", GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(box), close_button, FALSE, FALSE, 0); gtk_widget_show_all(box); /* Set up event box. */ |