Commit ba062e901aab0f9ec462a0c92df15017ba484332
1 parent
55d06d65
Exists in
master
and in
4 other branches
Adding fallbacks for application menu.
Showing
3 changed files
with
20 additions
and
2 deletions
Show diff stats
src/objects/window/header.c
@@ -49,6 +49,24 @@ | @@ -49,6 +49,24 @@ | ||
49 | 49 | ||
50 | g_autoptr(GtkBuilder) builder = pw3270_application_get_builder("window.xml"); | 50 | g_autoptr(GtkBuilder) builder = pw3270_application_get_builder("window.xml"); |
51 | 51 | ||
52 | + if(!gtk_application_prefers_app_menu(GTK_APPLICATION(g_application_get_default()))) { | ||
53 | + g_autoptr(GtkBuilder) app_builder = pw3270_application_get_builder("application.xml"); | ||
54 | + | ||
55 | + g_menu_insert_submenu( | ||
56 | + G_MENU(gtk_builder_get_object(builder,"open-menu")), | ||
57 | + 0, | ||
58 | + _("Help"), | ||
59 | + G_MENU_MODEL(gtk_builder_get_object(app_builder,"help-menu-placeholder")) | ||
60 | + ); | ||
61 | + | ||
62 | + g_menu_append_submenu( | ||
63 | + G_MENU(gtk_builder_get_object(builder,"preferences-menu")), | ||
64 | + _("View"), | ||
65 | + G_MENU_MODEL(gtk_builder_get_object(app_builder,"view-menu-placeholder")) | ||
66 | + ); | ||
67 | + | ||
68 | + } | ||
69 | + | ||
52 | if(g_strv_length(header_blocks) >= 2) { | 70 | if(g_strv_length(header_blocks) >= 2) { |
53 | 71 | ||
54 | gchar ** elements; | 72 | gchar ** elements; |
ui/application.xml
ui/window.xml