diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-02 18:25:23 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-02 18:25:23 (EDT) |
commit | 09460ca50fd9f64ff96831863e2a0b56349907ad (patch) | |
tree | 31f0eef22591b5e7649bf6e893e41afb99a4a451 /src/toolbars/navigation | |
parent | 1d11f65d6130ea487d3d72352bec0632ff556600 (diff) | |
download | marquee-09460ca50fd9f64ff96831863e2a0b56349907ad.zip marquee-09460ca50fd9f64ff96831863e2a0b56349907ad.tar.gz marquee-09460ca50fd9f64ff96831863e2a0b56349907ad.tar.bz2 |
MqMainMenu: Extract prefs/about/quit buttons into linked box
Diffstat (limited to 'src/toolbars/navigation')
-rw-r--r-- | src/toolbars/navigation/main-menu.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/toolbars/navigation/main-menu.c b/src/toolbars/navigation/main-menu.c index 602f5a0..6ea2d74 100644 --- a/src/toolbars/navigation/main-menu.c +++ b/src/toolbars/navigation/main-menu.c @@ -178,9 +178,28 @@ create_zoom_buttons(MqMainMenu *main_menu) return box; } +static GtkWidget * +create_application_buttons(MqMainMenu *main_menu) +{ + GtkWidget *box; + GtkWidget *preferences_button; + GtkWidget *about_button; + GtkWidget *quit_button; + + box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_style_context_add_class(gtk_widget_get_style_context(box), + "linked"); + + NEW_BUTTON(preferences, "preferences-desktop", "Preferences"); + NEW_BUTTON(about, "help-about", "About Marquee"); + NEW_BUTTON(quit, "application-exit", "Quit"); + + return box; +} + #undef NEW_BUTTON -#define BUTTON_ROWS 4 +#define BUTTON_ROWS 3 #define BUTTON_COLS 3 #define NEW_BUTTON(Y, X, ICON, TOOLTIP) \ G_STMT_START { \ @@ -216,10 +235,6 @@ create_main_grid(MqMainMenu *main_menu) NEW_BUTTON(2, 1, "document-print", "Print"); NEW_BUTTON(2, 2, "preferences-system", "Inspector"); - NEW_BUTTON(3, 0, "preferences-desktop", "Preferences"); - NEW_BUTTON(3, 1, "help-about", "About Marquee"); - NEW_BUTTON(3, 2, "application-exit", "Quit"); - CLICKED_CB(0, 0, new_window_clicked_cb); CLICKED_CB(0, 1, find_clicked_cb); CLICKED_CB(0, 2, fullscreen_clicked_cb); @@ -235,10 +250,6 @@ create_main_grid(MqMainMenu *main_menu) gtk_widget_set_sensitive(buttons[2 * BUTTON_COLS + 1], FALSE); CLICKED_CB(2, 2, inspector_clicked_cb); - CLICKED_CB(3, 0, preferences_clicked_cb); - CLICKED_CB(3, 1, about_clicked_cb); - CLICKED_CB(3, 2, quit_clicked_cb); - return grid; } @@ -258,6 +269,8 @@ menu_clicked_cb(MqMainMenu *main_menu) FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(box), create_main_grid(main_menu), FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(box), create_application_buttons(main_menu), + FALSE, FALSE, 0); /* Set up the popover. */ main_menu->popover = gtk_popover_new(GTK_WIDGET(main_menu)); |