Skip to content
Snippets Groups Projects
Verified Commit 1daac190 authored by Bruce Cowan's avatar Bruce Cowan :airplane:
Browse files

Use automatic primary menu keyboard shortcut

parent 6d5aceb1
No related branches found
No related tags found
No related merge requests found
Pipeline #3564 passed
...@@ -24,8 +24,9 @@ template RugbyAppWindow : Adw.ApplicationWindow { ...@@ -24,8 +24,9 @@ template RugbyAppWindow : Adw.ApplicationWindow {
} }
[end] [end]
MenuButton menu_button { MenuButton {
direction: none; direction: none;
primary: true;
menu-model: app_menu; menu-model: app_menu;
tooltip-text: "Main Menu"; tooltip-text: "Main Menu";
} }
......
...@@ -68,9 +68,6 @@ on_startup (GApplication *app, ...@@ -68,9 +68,6 @@ on_startup (GApplication *app,
app_entries, app_entries,
G_N_ELEMENTS (app_entries), G_N_ELEMENTS (app_entries),
app); app);
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
"win.show-primary-menu",
(const char*[]) { "F10", NULL });
gtk_application_set_accels_for_action (GTK_APPLICATION (app), gtk_application_set_accels_for_action (GTK_APPLICATION (app),
"app.prefs", "app.prefs",
(const char*[]) { "<Ctrl>comma", NULL }); (const char*[]) { "<Ctrl>comma", NULL });
......
...@@ -18,7 +18,6 @@ struct _RugbyAppWindow ...@@ -18,7 +18,6 @@ struct _RugbyAppWindow
AdwApplicationWindow parent; AdwApplicationWindow parent;
GtkWidget *scorespin; GtkWidget *scorespin;
GtkWidget *menu_button;
GtkWidget *stack; GtkWidget *stack;
GtkWidget *empty_page; GtkWidget *empty_page;
GtkWidget *list_page; GtkWidget *list_page;
...@@ -109,15 +108,6 @@ activate_score_changed (G_GNUC_UNUSED GSimpleAction *action, ...@@ -109,15 +108,6 @@ activate_score_changed (G_GNUC_UNUSED GSimpleAction *action,
g_assert_not_reached (); g_assert_not_reached ();
} }
static void
activate_show_primary_menu (G_GNUC_UNUSED GSimpleAction *action,
G_GNUC_UNUSED GVariant *parameter,
gpointer user_data)
{
RugbyAppWindow *self = RUGBY_APP_WINDOW (user_data);
gtk_menu_button_popup (GTK_MENU_BUTTON (self->menu_button));
}
static void static void
rugby_app_window_dispose (GObject *object) rugby_app_window_dispose (GObject *object)
{ {
...@@ -133,7 +123,6 @@ rugby_app_window_init (RugbyAppWindow *self) ...@@ -133,7 +123,6 @@ rugby_app_window_init (RugbyAppWindow *self)
const GActionEntry win_entries[] = { const GActionEntry win_entries[] = {
{ .name = "score-changed", .activate = activate_score_changed, .parameter_type = "s" }, { .name = "score-changed", .activate = activate_score_changed, .parameter_type = "s" },
{ .name = "show-primary-menu", .activate = activate_show_primary_menu },
}; };
g_action_map_add_action_entries (G_ACTION_MAP (self), g_action_map_add_action_entries (G_ACTION_MAP (self),
...@@ -157,7 +146,6 @@ rugby_app_window_class_init (RugbyAppWindowClass *klass) ...@@ -157,7 +146,6 @@ rugby_app_window_class_init (RugbyAppWindowClass *klass)
"/uk/me/bcowan/Rugby/gtk/window.ui"); "/uk/me/bcowan/Rugby/gtk/window.ui");
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, scorespin); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, scorespin);
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, menu_button);
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, stack); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, stack);
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, empty_page); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, empty_page);
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, list_page); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, list_page);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment