diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index ed4f65a..f3bfa41 100644 --- a/src/window.c +++ b/src/window.c @@ -60,6 +60,18 @@ tab_list_back_button_clicked_cb(GtkButton __attribute__((unused)) *button, gtk_grid_attach(GTK_GRID(button_grid), \ buttons[Y * BUTTON_COLS + X], X, Y, 1, 1); \ } while (0) +#define NEW_TOGGLE(Y, X, ICON, TOOLTIP) \ + do { \ + buttons[Y * BUTTON_COLS + X] = gtk_toggle_button_new(); \ + gtk_button_set_image(GTK_BUTTON(buttons[Y * BUTTON_COLS + X]), \ + gtk_image_new_from_icon_name(ICON, \ + GTK_ICON_SIZE_BUTTON)); \ + gtk_widget_set_tooltip_text(buttons[Y * BUTTON_COLS + X], \ + TOOLTIP); \ + gtk_widget_set_can_focus(buttons[Y * BUTTON_COLS + X], FALSE); \ + gtk_grid_attach(GTK_GRID(button_grid), \ + buttons[Y * BUTTON_COLS + X], X, Y, 1, 1); \ + } while (0) static gboolean tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) @@ -86,7 +98,7 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) NEW_BUTTON(0, 3, "window-close", "Close tab"); NEW_BUTTON(1, 0, "tab-new-symbolic", "New tab"); NEW_BUTTON(1, 1, "edit-undo", "Undo close tab"); - NEW_BUTTON(1, 3, "view-list-symbolic", "Tab list..."); + NEW_TOGGLE(1, 3, "view-list-symbolic", "Tab list..."); /* Set up the button rows box. */ box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); @@ -117,6 +129,7 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) #undef BUTTON_ROWS #undef BUTTON_COLS #undef NEW_BUTTON +#undef NEW_TOGGLE static void add_tab(MqWindow *window, gchar *uri, gint position) |