summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-22 16:47:13 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-22 16:47:13 (EDT)
commitb2a0a099cd87f55d75beba763d801b10add0aba3 (patch)
tree2ed918692b06c651f8b11cd12599029206a8dae8 /src
parentc6ac335990389ebbc8a67629ebe3b6ca6bf921a3 (diff)
downloadmarquee-b2a0a099cd87f55d75beba763d801b10add0aba3.zip
marquee-b2a0a099cd87f55d75beba763d801b10add0aba3.tar.gz
marquee-b2a0a099cd87f55d75beba763d801b10add0aba3.tar.bz2
MqTab: Make "New window" button functional
Diffstat (limited to 'src')
-rw-r--r--src/tab.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tab.c b/src/tab.c
index 79308c1..e557803 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -28,6 +28,12 @@
#include "tab-body.h"
static void
+new_window_clicked_cb(GtkWidget __attribute__((unused)) *button, MqTab *tab)
+{
+ mq_application_add_window(tab->application, NULL);
+}
+
+static void
tab_list_button_toggled_cb(GtkToggleButton *toggle_button, GtkWidget *tab_list)
{
if (gtk_toggle_button_get_active(toggle_button)) {
@@ -61,6 +67,8 @@ tab_list_button_toggled_cb(GtkToggleButton *toggle_button, GtkWidget *tab_list)
gtk_grid_attach(GTK_GRID(button_grid), \
buttons[Y * BUTTON_COLS + X], X, Y, 1, 1); \
} while (0)
+#define CLICKED_CB(Y, X, CB) \
+ g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", CB, tab);
static gboolean
tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
@@ -91,6 +99,8 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
NEW_BUTTON(1, 2, "edit-undo", "Undo close tab");
NEW_TOGGLE(1, 3, "view-list-symbolic", "Tab list...");
+ CLICKED_CB(1, 1, G_CALLBACK(new_window_clicked_cb));
+
/* Set up the tab list. */
tab_list = gtk_label_new("Tab list");
@@ -135,6 +145,7 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
#undef BUTTON_COLS
#undef NEW_BUTTON
#undef NEW_TOGGLE
+#undef CLICKED_CB
static void
mq_tab_populate_tab(MqTab *tab)