diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tab.c | 66 |
1 files changed, 33 insertions, 33 deletions
@@ -142,33 +142,6 @@ tab_list_button_toggled_cb(GtkToggleButton *toggle_button, GtkWidget *tab_list) } } -#define BUTTON_ROWS 2 -#define BUTTON_COLS 4 -#define NEW_BUTTON(Y, X, ICON, TOOLTIP) \ - do { \ - buttons[Y * BUTTON_COLS + X] = gtk_button_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) -#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) -#define CLICKED_CB(Y, X, CB) \ - g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", CB, tab) - static void create_tree_model_recurse(MqTab *node, GtkTreeStore *tree_store, GtkTreeIter *parent_tree_iter) @@ -226,6 +199,33 @@ create_tab_list(MqTab *tab) return scrolled_window; } +#define BUTTON_ROWS 2 +#define BUTTON_COLS 4 +#define NEW_BUTTON(Y, X, ICON, TOOLTIP) \ + do { \ + buttons[Y * BUTTON_COLS + X] = gtk_button_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) +#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) +#define CLICKED_CB(Y, X, CB) \ + g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", CB, tab) + static void create_tab_popover(GtkWidget *widget, MqTab *tab) { @@ -291,6 +291,12 @@ create_tab_popover(GtkWidget *widget, MqTab *tab) gtk_widget_hide(tab_list_scrolled_window); } +#undef BUTTON_ROWS +#undef BUTTON_COLS +#undef NEW_BUTTON +#undef NEW_TOGGLE +#undef CLICKED_CB + static gboolean tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) { @@ -307,12 +313,6 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) return FALSE; } -#undef BUTTON_ROWS -#undef BUTTON_COLS -#undef NEW_BUTTON -#undef NEW_TOGGLE -#undef CLICKED_CB - static void mq_tab_populate_tab(MqTab *tab) { |