summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-02 18:05:08 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-02 18:05:08 (EDT)
commitfac98f63fdab837afb93a2bfc04f74748be58390 (patch)
tree20915f39ab59ff5a4f03347a63afece4c970d580
parent11ab9cccd9c6d53de45ffc3ab6f81eebaa4de3f5 (diff)
downloadmarquee-fac98f63fdab837afb93a2bfc04f74748be58390.zip
marquee-fac98f63fdab837afb93a2bfc04f74748be58390.tar.gz
marquee-fac98f63fdab837afb93a2bfc04f74748be58390.tar.bz2
MqMainMenu: Pack button grid into a box
-rw-r--r--src/toolbars/navigation/main-menu.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/toolbars/navigation/main-menu.c b/src/toolbars/navigation/main-menu.c
index 13c7cc2..7ff3935 100644
--- a/src/toolbars/navigation/main-menu.c
+++ b/src/toolbars/navigation/main-menu.c
@@ -163,8 +163,8 @@ quit_clicked_cb(GtkButton G_GNUC_UNUSED *button, MqMainMenu *main_menu)
g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", \
G_CALLBACK(CB), main_menu)
-static void
-menu_clicked_cb(MqMainMenu *main_menu)
+static GtkWidget *
+create_main_grid(MqMainMenu *main_menu)
{
GtkWidget *grid;
GtkWidget *buttons[BUTTON_ROWS * BUTTON_COLS];
@@ -215,12 +215,7 @@ menu_clicked_cb(MqMainMenu *main_menu)
CLICKED_CB(4, 1, about_clicked_cb);
CLICKED_CB(4, 2, quit_clicked_cb);
- /* Set up the popover. */
- main_menu->popover = gtk_popover_new(GTK_WIDGET(main_menu));
- gtk_container_add(GTK_CONTAINER(main_menu->popover), grid);
-
- /* NB: gtk_popover_popup() is new in GTK+ 3.22. */
- gtk_widget_show_all(main_menu->popover);
+ return grid;
}
#undef BUTTON_ROWS
@@ -229,6 +224,24 @@ menu_clicked_cb(MqMainMenu *main_menu)
#undef CLICKED_CB
static void
+menu_clicked_cb(MqMainMenu *main_menu)
+{
+ GtkWidget *box;
+
+ box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+
+ gtk_box_pack_start(GTK_BOX(box), create_main_grid(main_menu),
+ FALSE, FALSE, 0);
+
+ /* Set up the popover. */
+ main_menu->popover = gtk_popover_new(GTK_WIDGET(main_menu));
+ gtk_container_add(GTK_CONTAINER(main_menu->popover), box);
+
+ /* NB: gtk_popover_popup() is new in GTK+ 3.22. */
+ gtk_widget_show_all(main_menu->popover);
+}
+
+static void
get_property(GObject *object, guint property_id, GValue *value,
GParamSpec *param_spec)
{