summaryrefslogtreecommitdiffstats
path: root/src/toolbars
diff options
context:
space:
mode:
Diffstat (limited to 'src/toolbars')
-rw-r--r--src/toolbars/navigation/main-menu.c51
1 files changed, 18 insertions, 33 deletions
diff --git a/src/toolbars/navigation/main-menu.c b/src/toolbars/navigation/main-menu.c
index 668111d..bfbfa23 100644
--- a/src/toolbars/navigation/main-menu.c
+++ b/src/toolbars/navigation/main-menu.c
@@ -293,7 +293,7 @@ create_zoom_buttons(MqMainMenu *main_menu)
#define BUTTON_ROWS 3
#define BUTTON_COLS 3
-#define NEW_BTN(Y, X, ICON, TOOLTIP) \
+#define NEW_BTN(Y, X, ID, ICON, TOOLTIP) \
G_STMT_START { \
buttons[Y * BUTTON_COLS + X] = gtk_button_new_from_icon_name(\
ICON, GTK_ICON_SIZE_BUTTON); \
@@ -307,12 +307,11 @@ create_zoom_buttons(MqMainMenu *main_menu)
GTK_BUTTON(buttons[Y * BUTTON_COLS + X]), TRUE); \
gtk_widget_set_tooltip_text(buttons[Y * BUTTON_COLS + X], \
TOOLTIP); \
+ g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", \
+ G_CALLBACK(ID ## _clicked_cb), main_menu); \
gtk_grid_attach(GTK_GRID(grid), buttons[Y * BUTTON_COLS + X], \
X, Y, 1, 1); \
} G_STMT_END
-#define CLICKED_CB(Y, X, CB) \
- g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", \
- G_CALLBACK(CB), main_menu)
static GtkWidget *
create_main_grid(MqMainMenu *main_menu)
@@ -325,38 +324,25 @@ create_main_grid(MqMainMenu *main_menu)
gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE);
gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE);
- /* Y, X, ICON, TOOLTIP */
- NEW_BTN(0, 0, "window-new", "New window");
- NEW_BTN(0, 1, "edit-find", "Find");
- NEW_BTN(0, 2, "view-fullscreen", "Full screen");
-
- /* Y, X, ICON, TOOLTIP */
- NEW_BTN(1, 0, "document-open", "Open file");
- NEW_BTN(1, 1, "document-save-as", "Save page");
- NEW_BTN(1, 2, "mail-message-new", "E-mail link");
-
- /* Y, X, ICON, TOOLTIP */
- NEW_BTN(2, 0, "document-print-preview", "Print preview");
- NEW_BTN(2, 1, "document-print", "Print");
- NEW_BTN(2, 2, "preferences-system", "Inspector");
-
- /* Y, X, CB */
- CLICKED_CB(0, 0, new_window_clicked_cb);
- CLICKED_CB(0, 1, find_clicked_cb);
- CLICKED_CB(0, 2, fullscreen_clicked_cb);
-
- /* Y, X, CB */
- CLICKED_CB(1, 0, open_clicked_cb);
- CLICKED_CB(1, 1, save_clicked_cb);
- CLICKED_CB(1, 2, email_link_clicked_cb);
+ /* Y, X, ID, ICON, TOOLTIP */
+ NEW_BTN(0, 0, new_window, "window-new", "New window");
+ NEW_BTN(0, 1, find, "edit-find", "Find");
+ NEW_BTN(0, 2, fullscreen, "view-fullscreen", "Full screen");
+
+ /* Y, X, ID, ICON, TOOLTIP */
+ NEW_BTN(1, 0, open, "document-open", "Open file");
+ NEW_BTN(1, 1, save, "document-save-as", "Save page");
+ NEW_BTN(1, 2, email_link, "mail-message-new", "E-mail link");
+
+ /* Y, X, ID, ICON, TOOLTIP */
+ NEW_BTN(2, 0, print_preview, "document-print-preview", "Print preview");
+ NEW_BTN(2, 1, print, "document-print", "Print");
+ NEW_BTN(2, 2, inspector, "preferences-system", "Inspector");
+
gtk_widget_set_sensitive(buttons[1 * BUTTON_COLS + 2], FALSE);
- /* Y, X, CB */
- CLICKED_CB(2, 0, print_preview_clicked_cb);
gtk_widget_set_sensitive(buttons[2 * BUTTON_COLS + 0], FALSE);
- CLICKED_CB(2, 1, print_clicked_cb);
gtk_widget_set_sensitive(buttons[2 * BUTTON_COLS + 1], FALSE);
- CLICKED_CB(2, 2, inspector_clicked_cb);
return grid;
}
@@ -364,7 +350,6 @@ create_main_grid(MqMainMenu *main_menu)
#undef BUTTON_ROWS
#undef BUTTON_COLS
#undef NEW_BTN
-#undef CLICKED_CB
#define NEW_BUTTON(ID, ICON, LABEL, TOOLTIP) \
G_STMT_START { \