summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-28 14:36:58 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-28 14:36:58 (EDT)
commited2e24de47d5ccd32c258426ccf010aeb98768b8 (patch)
treeb3ed8a79e3449a39edd839a1badba66fddc1f51c
parent3844195417b51c9bff6ee73ef5140a2bec84e492 (diff)
downloadmarquee-ed2e24de47d5ccd32c258426ccf010aeb98768b8.zip
marquee-ed2e24de47d5ccd32c258426ccf010aeb98768b8.tar.gz
marquee-ed2e24de47d5ccd32c258426ccf010aeb98768b8.tar.bz2
MqTab: Move macro (un)definitions
-rw-r--r--src/tab.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/tab.c b/src/tab.c
index 0452106..23480c9 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -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)
{