[devhelp/alatiera/remove-amtk: 3/3] Revert "Revert "Revert the introduction of the amtk library""




commit 1d5c8da15ab7fbff9b568630c5892fddce8cb44c
Author: Jordan Petridis <jordan centricular com>
Date:   Sat Apr 10 01:57:50 2021 +0300

    Revert "Revert "Revert the introduction of the amtk library""
    
    This reverts commit 18369a6958664f10b68c9edb749dbd3af7cc731a.
    
    amtk is now archived.

 .gitignore                     |   1 +
 .gitlab-ci.yml                 |   2 +-
 README.md                      |   1 -
 flatpak/org.gnome.Devhelp.json |  45 ++++++++
 flatpak/org.gnome.Devhelp.yml  |  45 --------
 meson.build                    |   2 +-
 po/POTFILES.in                 |   3 +
 src/dh-app.c                   | 255 +++++++++++++----------------------------
 src/dh-app.h                   |   2 -
 src/dh-main.c                  |   3 -
 src/dh-window.c                | 255 ++++++++---------------------------------
 src/dh-window.ui               | 245 +++++++++++++++++++++++++++++++++++++++
 src/dh.gresource.xml           |   5 +
 src/help-overlay.ui            | 117 +++++++++++++++++++
 src/menus.ui                   |  58 ++++++++++
 15 files changed, 600 insertions(+), 439 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 567609b1..47656a4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 build/
+_build/
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 343a5b6f..b143e0a7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,7 +12,7 @@ flatpak:
   stage: build
   extends: .flatpak
   variables:
-    MANIFEST_PATH: "flatpak/org.gnome.Devhelp.yml"
+    MANIFEST_PATH: "flatpak/org.gnome.Devhelp.json"
     FLATPAK_MODULE: "devhelp"
     APP_ID: "org.gnome.Devhelp"
     RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo";
diff --git a/README.md b/README.md
index 6057f78b..2d83a3c2 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,6 @@ Dependencies
 - GLib
 - GTK
 - WebKitGTK
-- [Amtk](https://wiki.gnome.org/Projects/Amtk)
 - gsettings-desktop-schemas
 
 Description
diff --git a/flatpak/org.gnome.Devhelp.json b/flatpak/org.gnome.Devhelp.json
new file mode 100644
index 00000000..a2d1372d
--- /dev/null
+++ b/flatpak/org.gnome.Devhelp.json
@@ -0,0 +1,45 @@
+{
+    "app-id" : "org.gnome.Devhelp",
+    "runtime" : "org.gnome.Sdk",
+    "runtime-version" : "master",
+    "sdk" : "org.gnome.Sdk",
+    "command" : "devhelp",
+    "tags" : [
+        "nightly"
+    ],
+    "desktop-file-name-prefix" : "(Nightly) ",
+    "finish-args" : [
+        "--share=ipc",
+        "--socket=x11",
+        "--socket=wayland",
+        "--device=dri",
+        "--filesystem=host:ro"
+    ],
+    "cleanup" : [
+        "/include",
+        "/lib/pkgconfig",
+        "/share/pkgconfig",
+        "share/aclocal",
+        "man",
+        "share/man",
+        "*.la",
+        "*.a"
+    ],
+    "modules" : [
+        {
+            "name" : "devhelp",
+            "buildsystem" : "meson",
+            "config-opts" : [
+                "-Dflatpak_build=true"
+            ],
+            "run-tests" : true,
+            "sources" : [
+                {
+                    "type" : "git",
+                    "url" : "https://gitlab.gnome.org/GNOME/devhelp.git";,
+                    "branch" : "master"
+                }
+            ]
+        }
+    ]
+}
diff --git a/meson.build b/meson.build
index bdd66056..d71d748d 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,7 @@ LIBDEVHELP_DEPS = [
 
 DEVHELP_APP_DEPS = [
   LIBDEVHELP_DEPS,
-  dependency('amtk-5', version: '>= 5.0'),
+  dependency('gsettings-desktop-schemas'),
 ]
 
 # config.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index db463e9e..cd6e6ed8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -42,3 +42,6 @@ src/dh-preferences.ui
 src/dh-settings-app.c
 src/dh-util-app.c
 src/dh-window.c
+src/dh-window.ui
+src/help-overlay.ui
+src/menus.ui
diff --git a/src/dh-app.c b/src/dh-app.c
index 9ceae7f0..da97158c 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -10,164 +10,12 @@
 #include "config.h"
 #include "dh-app.h"
 #include <glib/gi18n.h>
-#include <amtk/amtk.h>
 #include "dh-assistant.h"
 #include "dh-preferences.h"
 #include "dh-settings-app.h"
 #include "dh-util-app.h"
 
-struct _DhAppPrivate {
-        /* AmtkActionInfoStore for actions that are present in a menu. */
-        AmtkActionInfoStore *menu_action_info_store;
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (DhApp, dh_app, GTK_TYPE_APPLICATION);
-
-/* This function adds the AmtkActionInfo's for the GActions that are present in
- * a menu.
- */
-static void
-add_menu_action_infos (DhApp *app)
-{
-        const gchar *accels[] = {NULL, NULL, NULL, NULL};
-        AmtkActionInfo *action_info;
-
-        const AmtkActionInfoEntry entries[] = {
-                /* action, icon, label, accel, tooltip */
-
-                /* Actions related to the whole application */
-                { "app.new-window", NULL, N_("New _Window"), "<Control>n",
-                  N_("Open a new window") },
-                { "app.preferences", NULL, N_("_Preferences") },
-                { "win.shortcuts-window", NULL, N_("_Keyboard Shortcuts"), "<Control>question",
-                  N_("Show keyboard shortcuts") },
-                { "app.help", NULL, N_("_Help"), "F1",
-                  N_("Show help") },
-                { "app.about", NULL, N_("_About Devhelp") },
-                { "app.quit", NULL, N_("_Quit"), "<Control>q",
-                  N_("Close all windows (quit the application)") },
-
-                /* Actions related to the current main window */
-                { "win.show-sidebar", NULL, N_("_Side Panel"), "F9",
-                  N_("Toggle side panel visibility") },
-                { "win.print", NULL, N_("_Print"), "<Control>p" },
-                { "win.find", NULL, N_("_Find"), "<Control>f",
-                  N_("Find in current page") },
-                { "win.zoom-in", NULL, N_("_Larger Text"), NULL,
-                  N_("Larger text") },
-                { "win.zoom-out", NULL, N_("S_maller Text"), NULL,
-                  N_("Smaller text") },
-                { "win.zoom-default", NULL, N_("_Normal Size"), NULL,
-                  N_("Normal size") },
-                { NULL }
-        };
-
-        g_assert (app->priv->menu_action_info_store == NULL);
-        app->priv->menu_action_info_store = amtk_action_info_store_new ();
-
-        amtk_action_info_store_add_entries (app->priv->menu_action_info_store,
-                                            entries, -1,
-                                            GETTEXT_PACKAGE);
-
-        /* The same as in Epiphany. */
-        accels[0] = "<Control>minus";
-        accels[1] = "<Control>KP_Subtract";
-        action_info = amtk_action_info_store_lookup (app->priv->menu_action_info_store, "win.zoom-out");
-        amtk_action_info_set_accels (action_info, accels);
-
-        /* The same as in Epiphany. */
-        accels[0] = "<Control>0";
-        accels[1] = "<Control>KP_0";
-        action_info = amtk_action_info_store_lookup (app->priv->menu_action_info_store, "win.zoom-default");
-        amtk_action_info_set_accels (action_info, accels);
-
-        /* For "<Control>equal": Epiphany also has this keyboard shortcut for
-         * zoom-in. On keyboards the = and + are usually on the same key, but +
-         * is less convenient to type because Shift must be pressed too.
-         * Apparently it's usual on Windows to press Ctrl+= to zoom in.
-         * https://bugzilla.gnome.org/show_bug.cgi?id=743704
-         */
-        accels[0] = "<Control>plus";
-        accels[1] = "<Control>equal";
-        accels[2] = "<Control>KP_Add";
-        action_info = amtk_action_info_store_lookup (app->priv->menu_action_info_store, "win.zoom-in");
-        amtk_action_info_set_accels (action_info, accels);
-
-        amtk_action_info_store_set_all_accels_to_app (app->priv->menu_action_info_store,
-                                                      GTK_APPLICATION (app));
-}
-
-/* This function adds the AmtkActionInfo's for other GActions (GActions that are
- * not present in a menu).
- */
-static void
-add_other_action_infos (DhApp *app)
-{
-        AmtkActionInfoStore *store;
-        AmtkActionInfo *action_info;
-        const gchar *accels[] = {NULL, NULL, NULL, NULL};
-
-        const AmtkActionInfoEntry entries[] = {
-                /* action, icon, label, accel, tooltip */
-                { "win.new-tab", NULL, NULL, "<Control>t", N_("Open a new tab") },
-                { "win.close-tab", NULL, NULL, "<Control>w", N_("Close the current tab") },
-                { "win.go-back", NULL, NULL, NULL, N_("Go back") },
-                { "win.go-forward", NULL, NULL, NULL, N_("Go forward") },
-                { "win.focus-search", NULL, NULL, NULL, N_("Focus global search") },
-                { NULL }
-        };
-
-        store = amtk_action_info_store_new ();
-        amtk_action_info_store_add_entries (store, entries, -1, GETTEXT_PACKAGE);
-
-        accels[0] = "<Alt>Left";
-        accels[1] = "Back";
-        action_info = amtk_action_info_store_lookup (store, "win.go-back");
-        amtk_action_info_set_accels (action_info, accels);
-
-        accels[0] = "<Alt>Right";
-        accels[1] = "Forward";
-        action_info = amtk_action_info_store_lookup (store, "win.go-forward");
-        amtk_action_info_set_accels (action_info, accels);
-
-        accels[0] = "<Control>k";
-        accels[1] = "<Control>s";
-        accels[2] = "<Control>l";
-        action_info = amtk_action_info_store_lookup (store, "win.focus-search");
-        amtk_action_info_set_accels (action_info, accels);
-
-        amtk_action_info_store_set_all_accels_to_app (store, GTK_APPLICATION (app));
-        g_object_unref (store);
-}
-
-/* This function adds the AmtkActionInfo's for things that have no related
- * GActions.
- */
-static void
-add_no_gaction_action_infos (void)
-{
-        AmtkActionInfoStore *store;
-
-        const AmtkActionInfoEntry entries[] = {
-                /* action, icon, label, accel, tooltip */
-                { "no-gaction-open-menu", NULL, NULL, "F10", N_("Open the menu") },
-                { "no-gaction-prev-tab", NULL, NULL, "<Control>Page_Up", N_("Previous tab") },
-                { "no-gaction-next-tab", NULL, NULL, "<Control>Page_Down", N_("Next tab") },
-                { NULL }
-        };
-
-        store = amtk_action_info_store_new ();
-        amtk_action_info_store_add_entries (store, entries, -1, GETTEXT_PACKAGE);
-        g_object_unref (store);
-}
-
-static void
-add_action_infos (DhApp *app)
-{
-        add_menu_action_infos (app);
-        add_other_action_infos (app);
-        add_no_gaction_action_infos ();
-}
+G_DEFINE_TYPE (DhApp, dh_app, GTK_TYPE_APPLICATION);
 
 static DhAssistant *
 get_active_assistant_window (DhApp *app)
@@ -229,8 +77,6 @@ new_window_cb (GSimpleAction *action,
 
         new_window = dh_window_new (GTK_APPLICATION (app));
         gtk_widget_show_all (new_window);
-
-        amtk_action_info_store_check_all_used (app->priv->menu_action_info_store);
 }
 
 static void
@@ -391,10 +237,10 @@ add_action_entries (DhApp *app)
                 { "raise", raise_cb },
         };
 
-        amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (app),
-                                                       app_entries,
-                                                       G_N_ELEMENTS (app_entries),
-                                                       app);
+        g_action_map_add_action_entries (G_ACTION_MAP (app),
+                                         app_entries,
+                                         G_N_ELEMENTS (app_entries),
+                                         app);
 }
 
 static void
@@ -426,23 +272,91 @@ setup_go_to_tab_accelerators (GtkApplication *app)
 }
 
 static void
-setup_additional_accelerators (GtkApplication *app)
+setup_accelerators (GtkApplication *app)
 {
-        const gchar *accels[] = {NULL, NULL};
+        const gchar *accels[] = {NULL, NULL, NULL, NULL};
 
         setup_go_to_tab_accelerators (app);
 
+        accels[0] = "<Control>0";
+        gtk_application_set_accels_for_action (app, "win.zoom-default", accels);
+
+        accels[0] = "<Control>minus";
+        gtk_application_set_accels_for_action (app, "win.zoom-out", accels);
+
+        /* For "<Control>equal": Epiphany also has this keyboard shortcut for
+         * zoom-in. On keyboards the = and + are usually on the same key, but +
+         * is less convenient to type because Shift must be pressed too.
+         * Apparently it's usual on Windows to press Ctrl+= to zoom in.
+         * https://bugzilla.gnome.org/show_bug.cgi?id=743704
+         */
+        accels[0] = "<Control>plus";
+        accels[1] = "<Control>equal";
+        gtk_application_set_accels_for_action (app, "win.zoom-in", accels);
+        accels[1] = NULL;
+
+        accels[0] = "<Control>f";
+        gtk_application_set_accels_for_action (app, "win.find", accels);
+
         accels[0] = "<Control>c";
         gtk_application_set_accels_for_action (app, "win.copy", accels);
 
+        accels[0] = "<Control>p";
+        gtk_application_set_accels_for_action (app, "win.print", accels);
+
+        accels[0] = "<Control>t";
+        gtk_application_set_accels_for_action (app, "win.new-tab", accels);
+
+        accels[0] = "<Control>n";
+        gtk_application_set_accels_for_action (app, "app.new-window", accels);
+
         accels[0] = "<Control>Page_Down";
         gtk_application_set_accels_for_action (app, "win.next-tab", accels);
 
         accels[0] = "<Control>Page_Up";
         gtk_application_set_accels_for_action (app, "win.prev-tab", accels);
 
+        accels[0] = "<Control>w";
+        gtk_application_set_accels_for_action (app, "win.close-tab", accels);
+
+        accels[0] = "<Control>q";
+        gtk_application_set_accels_for_action (app, "app.quit", accels);
+
+        accels[0] = "F1";
+        gtk_application_set_accels_for_action (app, "app.help", accels);
+
+        accels[0] = "F9";
+        gtk_application_set_accels_for_action (app, "win.show-sidebar", accels);
+
         accels[0] = "F10";
         gtk_application_set_accels_for_action (app, "win.show-window-menu", accels);
+
+        accels[0] = "<Alt>Right";
+        accels[1] = "Forward";
+        gtk_application_set_accels_for_action (app, "win.go-forward", accels);
+
+        accels[0] = "<Alt>Left";
+        accels[1] = "Back";
+        gtk_application_set_accels_for_action (app, "win.go-back", accels);
+
+        accels[0] = "<Control>k";
+        accels[1] = "<Control>s";
+        accels[2] = "<Control>l";
+        gtk_application_set_accels_for_action (app, "win.focus-search", accels);
+}
+
+static void
+set_app_menu_if_needed (GtkApplication *app)
+{
+        GMenu *manual_app_menu;
+
+        manual_app_menu = gtk_application_get_menu_by_id (app, "manual-app-menu");
+
+        /* Have the g_return in all cases, to catch problems in all cases. */
+        g_return_if_fail (manual_app_menu != NULL);
+
+        if (gtk_application_prefers_app_menu (app))
+                gtk_application_set_app_menu (app, G_MENU_MODEL (manual_app_menu));
 }
 
 static void
@@ -455,9 +369,9 @@ dh_app_startup (GApplication *application)
         if (G_APPLICATION_CLASS (dh_app_parent_class)->startup != NULL)
                 G_APPLICATION_CLASS (dh_app_parent_class)->startup (application);
 
-        add_action_infos (app);
         add_action_entries (app);
-        setup_additional_accelerators (GTK_APPLICATION (app));
+        setup_accelerators (GTK_APPLICATION (app));
+        set_app_menu_if_needed (GTK_APPLICATION (app));
 }
 
 static void
@@ -550,24 +464,11 @@ dh_app_command_line (GApplication            *g_app,
         return 0;
 }
 
-static void
-dh_app_dispose (GObject *object)
-{
-        DhApp *app = DH_APP (object);
-
-        g_clear_object (&app->priv->menu_action_info_store);
-
-        G_OBJECT_CLASS (dh_app_parent_class)->dispose (object);
-}
-
 static void
 dh_app_class_init (DhAppClass *klass)
 {
-        GObjectClass *object_class = G_OBJECT_CLASS (klass);
         GApplicationClass *application_class = G_APPLICATION_CLASS (klass);
 
-        object_class->dispose = dh_app_dispose;
-
         application_class->startup = dh_app_startup;
         application_class->activate = dh_app_activate;
         application_class->handle_local_options = dh_app_handle_local_options;
@@ -577,8 +478,6 @@ dh_app_class_init (DhAppClass *klass)
 static void
 dh_app_init (DhApp *app)
 {
-        app->priv = dh_app_get_instance_private (app);
-
         /* Translators: please don't translate "Devhelp" (it's marked as
          * translatable for transliteration only).
          */
diff --git a/src/dh-app.h b/src/dh-app.h
index d7ce15ba..5be3d939 100644
--- a/src/dh-app.h
+++ b/src/dh-app.h
@@ -21,11 +21,9 @@ G_BEGIN_DECLS
 
 typedef struct _DhApp        DhApp;
 typedef struct _DhAppClass   DhAppClass;
-typedef struct _DhAppPrivate DhAppPrivate;
 
 struct _DhApp {
         GtkApplication parent_instance;
-        DhAppPrivate *priv;
 };
 
 struct _DhAppClass {
diff --git a/src/dh-main.c b/src/dh-main.c
index 50d21974..f28aefde 100644
--- a/src/dh-main.c
+++ b/src/dh-main.c
@@ -8,7 +8,6 @@
 #include <locale.h>
 #include <glib/gi18n.h>
 #include <devhelp/devhelp.h>
-#include <amtk/amtk.h>
 #include "dh-app.h"
 #include "dh-settings-app.h"
 
@@ -22,13 +21,11 @@ main (int argc, char **argv)
         textdomain (GETTEXT_PACKAGE);
 
         dh_init ();
-        amtk_init ();
 
         application = dh_app_new ();
         status = g_application_run (G_APPLICATION (application), argc, argv);
         g_object_unref (application);
 
-        amtk_finalize ();
         dh_finalize ();
         dh_settings_app_unref_singleton ();
 
diff --git a/src/dh-window.c b/src/dh-window.c
index 6dea6209..f29d5d62 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -10,13 +10,17 @@
 #include <glib/gi18n.h>
 #include <webkit2/webkit2.h>
 #include <devhelp/devhelp.h>
-#include <amtk/amtk.h>
 #include "dh-settings-app.h"
 #include "dh-util-app.h"
 
 typedef struct {
         GtkHeaderBar *header_bar;
-        GtkMenuButton *menu_button;
+        GtkMenuButton *window_menu_button;
+        GMenuModel *window_menu_plus_app_menu;
+
+        GtkPaned *hpaned;
+        GtkWidget *grid_sidebar;
+        GtkWidget *grid_documents;
 
         DhSidebar *sidebar;
         DhSearchBar *search_bar;
@@ -47,7 +51,7 @@ dh_window_dispose (GObject *object)
         DhWindowPrivate *priv = dh_window_get_instance_private (DH_WINDOW (object));
 
         priv->header_bar = NULL;
-        priv->menu_button = NULL;
+        priv->window_menu_button = NULL;
         priv->sidebar = NULL;
         priv->search_bar = NULL;
         priv->notebook = NULL;
@@ -64,6 +68,15 @@ dh_window_class_init (DhWindowClass *klass)
         widget_class->delete_event = dh_window_delete_event;
 
         object_class->dispose = dh_window_dispose;
+
+        /* Bind class to template */
+        gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/devhelp/dh-window.ui");
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, header_bar);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, window_menu_button);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, window_menu_plus_app_menu);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, hpaned);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_sidebar);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_documents);
 }
 
 /* Can return NULL during initialization and finalization, so it's better to
@@ -225,8 +238,13 @@ close_tab_cb (GSimpleAction *action,
         DhWindowPrivate *priv = dh_window_get_instance_private (window);
         gint page_num;
 
-        page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
-        gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), page_num);
+        /* FIXME: the code here closes the current *tab*, but in help-overlay.ui
+         * it is documented as "Close the current window". Look for example at
+         * what gedit does, or other GNOME apps with a GtkNotebook plus Ctrl+W
+         * shortcut, and do the same.
+         */
+        page_num = gtk_notebook_get_current_page (priv->notebook);
+        gtk_notebook_remove_page (priv->notebook, page_num);
 }
 
 static void
@@ -354,69 +372,6 @@ go_forward_cb (GSimpleAction *action,
                 webkit_web_view_go_forward (WEBKIT_WEB_VIEW (web_view));
 }
 
-static void
-shortcuts_window_cb (GSimpleAction *action,
-                     GVariant      *parameter,
-                     gpointer       user_data)
-{
-        DhWindow *app_window = DH_WINDOW (user_data);
-        GtkShortcutsWindow *shortcuts_window;
-        GtkContainer *section;
-        GtkContainer *group;
-        AmtkFactory *factory;
-
-        shortcuts_window = amtk_shortcuts_window_new (GTK_WINDOW (app_window));
-
-        section = amtk_shortcuts_section_new (NULL);
-        g_object_set (section,
-                      "max-height", 10,
-                      NULL);
-
-        factory = amtk_factory_new (NULL);
-        amtk_factory_set_default_flags (factory, AMTK_FACTORY_IGNORE_GACTION);
-
-        group = amtk_shortcuts_group_new (_("Search"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.focus-search"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.find"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        group = amtk_shortcuts_group_new (_("History"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.go-back"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.go-forward"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        group = amtk_shortcuts_group_new (_("Zoom"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.zoom-in"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.zoom-out"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.zoom-default"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        group = amtk_shortcuts_group_new (_("Tabs and Windows"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.new-tab"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "app.new-window"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "no-gaction-prev-tab"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "no-gaction-next-tab"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.close-tab"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "app.quit"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        group = amtk_shortcuts_group_new (_("Miscellaneous"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.print"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.show-sidebar"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        group = amtk_shortcuts_group_new (_("General"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "app.help"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "no-gaction-open-menu"));
-        gtk_container_add (group, amtk_factory_create_shortcut (factory, "win.shortcuts-window"));
-        gtk_container_add (section, GTK_WIDGET (group));
-
-        g_object_unref (factory);
-
-        gtk_container_add (GTK_CONTAINER (shortcuts_window), GTK_WIDGET (section));
-        gtk_widget_show_all (GTK_WIDGET (shortcuts_window));
-}
-
 static void
 add_actions (DhWindow *window)
 {
@@ -445,140 +400,26 @@ add_actions (DhWindow *window)
                 /* Go */
                 { "go-back", go_back_cb },
                 { "go-forward", go_forward_cb },
-
-                /* Help */
-                { "shortcuts-window", shortcuts_window_cb },
         };
 
-        amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (window),
-                                                       win_entries,
-                                                       G_N_ELEMENTS (win_entries),
-                                                       window);
+        g_action_map_add_action_entries (G_ACTION_MAP (window),
+                                         win_entries,
+                                         G_N_ELEMENTS (win_entries),
+                                         window);
 
         property_action = g_property_action_new ("show-sidebar",
-                                                 priv->sidebar,
+                                                 priv->grid_sidebar,
                                                  "visible");
         g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (property_action));
         g_object_unref (property_action);
 
         property_action = g_property_action_new ("show-window-menu",
-                                                 priv->menu_button,
+                                                 priv->window_menu_button,
                                                  "active");
         g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (property_action));
         g_object_unref (property_action);
 }
 
-static GMenuModel *
-create_menu (void)
-{
-        GMenu *menu;
-        GMenu *section;
-        AmtkFactory *factory;
-
-        menu = g_menu_new ();
-        factory = amtk_factory_new (NULL);
-
-        section = g_menu_new ();
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "app.new-window"));
-        amtk_gmenu_append_section (menu, NULL, section);
-
-        section = g_menu_new ();
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.show-sidebar"));
-        amtk_gmenu_append_section (menu, NULL, section);
-
-        section = g_menu_new ();
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.print"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.find"));
-        amtk_gmenu_append_section (menu, NULL, section);
-
-        section = g_menu_new ();
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.zoom-in"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.zoom-out"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.zoom-default"));
-        amtk_gmenu_append_section (menu, NULL, section);
-
-        section = g_menu_new ();
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "app.preferences"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "win.shortcuts-window"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "app.help"));
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "app.about"));
-        /* Keep the Quit menu item. The GNOME goal recommends to remove it:
-         * https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement
-         * “There is no need for the Quit menu item and the recommendation is to
-         * remove it from all locations.”
-         * In Devhelp, there *is* a need for the Quit menu item: after
-         * installing/uninstalling books on the filesystem, it may be necessary
-         * to restart Devhelp because the file monitoring is not perfect, see
-         * the class description of DhBookListDirectory. Instead of closing the
-         * Devhelp windows one by one, it's simpler to quit the whole
-         * application at once. But this can be fixed by adding a “reload books”
-         * action.
-         * Another use-case with the Quit menu item is when the app bugs, just
-         * restarting the app will most probably fix the problem (and then the
-         * user needs to avoid repeating the actions that make the app to bug).
-         */
-        amtk_gmenu_append_item (section, amtk_factory_create_gmenu_item (factory, "app.quit"));
-        amtk_gmenu_append_section (menu, NULL, section);
-
-        g_object_unref (factory);
-        g_menu_freeze (menu);
-
-        return G_MENU_MODEL (menu);
-}
-
-static void
-init_header_bar (DhWindow *window)
-{
-        DhWindowPrivate *priv = dh_window_get_instance_private (window);
-        GtkWidget *back_forward_hbox;
-        GtkStyleContext *style_context;
-        GtkWidget *back_button;
-        GtkWidget *forward_button;
-        GMenuModel *menu;
-        GtkWidget *new_tab_button;
-
-        g_assert (priv->header_bar == NULL);
-        g_assert (priv->menu_button == NULL);
-
-        priv->header_bar = GTK_HEADER_BAR (gtk_header_bar_new ());
-        gtk_header_bar_set_show_close_button (priv->header_bar, TRUE);
-
-        /* Back/forward buttons */
-        back_forward_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-        style_context = gtk_widget_get_style_context (back_forward_hbox);
-        // Test also in RTL (right-to-left) text. It needs to be a GtkBox.
-        gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_LINKED);
-
-        back_button = gtk_button_new_from_icon_name ("go-previous-symbolic", GTK_ICON_SIZE_BUTTON);
-        gtk_actionable_set_action_name (GTK_ACTIONABLE (back_button), "win.go-back");
-        gtk_widget_set_tooltip_text (back_button, _("Back"));
-
-        forward_button = gtk_button_new_from_icon_name ("go-next-symbolic", GTK_ICON_SIZE_BUTTON);
-        gtk_actionable_set_action_name (GTK_ACTIONABLE (forward_button), "win.go-forward");
-        gtk_widget_set_tooltip_text (forward_button, _("Forward"));
-
-        gtk_container_add (GTK_CONTAINER (back_forward_hbox), back_button);
-        gtk_container_add (GTK_CONTAINER (back_forward_hbox), forward_button);
-        gtk_header_bar_pack_start (priv->header_bar, back_forward_hbox);
-
-        /* Menu */
-        priv->menu_button = GTK_MENU_BUTTON (gtk_menu_button_new ());
-        gtk_menu_button_set_direction (priv->menu_button, GTK_ARROW_NONE);
-        gtk_header_bar_pack_end (priv->header_bar, GTK_WIDGET (priv->menu_button));
-
-        menu = create_menu ();
-        gtk_menu_button_set_menu_model (priv->menu_button, menu);
-        g_object_unref (menu);
-
-        /* New tab button */
-        new_tab_button = gtk_button_new_from_icon_name ("tab-new-symbolic", GTK_ICON_SIZE_BUTTON);
-        gtk_actionable_set_action_name (GTK_ACTIONABLE (new_tab_button), "win.new-tab");
-        gtk_widget_set_tooltip_text (new_tab_button, _("New Tab"));
-        gtk_header_bar_pack_end (priv->header_bar, new_tab_button);
-
-        gtk_widget_show_all (GTK_WIDGET (priv->header_bar));
-}
-
 static void
 web_view_title_notify_cb (DhWebView  *web_view,
                           GParamSpec *param_spec,
@@ -655,34 +496,36 @@ static void
 dh_window_init (DhWindow *window)
 {
         DhWindowPrivate *priv = dh_window_get_instance_private (window);
-        GtkPaned *hpaned;
+        GtkApplication *app;
         DhSettingsApp *settings;
         GSettings *paned_settings;
-        GtkWidget *contents_vgrid;
 
-        /* Header bar */
-        init_header_bar (window);
-        gtk_window_set_titlebar (GTK_WINDOW (window), GTK_WIDGET (priv->header_bar));
+        gtk_widget_init_template (GTK_WIDGET (window));
+
+        add_actions (window);
 
-        /* Horizontal paned */
-        hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
+        app = GTK_APPLICATION (g_application_get_default ());
+        if (!gtk_application_prefers_app_menu (app)) {
+                gtk_menu_button_set_menu_model (priv->window_menu_button,
+                                                priv->window_menu_plus_app_menu);
+        }
 
         settings = dh_settings_app_get_singleton ();
         paned_settings = dh_settings_app_peek_paned_settings (settings);
         g_settings_bind (paned_settings, "position",
-                         hpaned, "position",
+                         priv->hpaned, "position",
                          G_SETTINGS_BIND_DEFAULT |
                          G_SETTINGS_BIND_NO_SENSITIVITY);
 
-        /* Left side of hpaned */
+        /* Sidebar */
         priv->sidebar = dh_sidebar_new2 (NULL);
-
-        /* Right side of hpaned */
-        contents_vgrid = gtk_grid_new ();
-        gtk_orientable_set_orientation (GTK_ORIENTABLE (contents_vgrid), GTK_ORIENTATION_VERTICAL);
+        gtk_widget_show (GTK_WIDGET (priv->sidebar));
+        gtk_container_add (GTK_CONTAINER (priv->grid_sidebar),
+                           GTK_WIDGET (priv->sidebar));
 
         // DhNotebook
         priv->notebook = dh_notebook_new (NULL);
+        gtk_widget_show (GTK_WIDGET (priv->notebook));
 
         dh_application_window_bind_sidebar_and_notebook (priv->sidebar, priv->notebook);
 
@@ -703,16 +546,12 @@ dh_window_init (DhWindow *window)
 
         // DhSearchBar
         priv->search_bar = dh_search_bar_new (priv->notebook);
+        gtk_widget_show (GTK_WIDGET (priv->search_bar));
 
-        /* Packing */
-        gtk_container_add (GTK_CONTAINER (contents_vgrid),
+        gtk_container_add (GTK_CONTAINER (priv->grid_documents),
                            GTK_WIDGET (priv->search_bar));
-        gtk_container_add (GTK_CONTAINER (contents_vgrid),
+        gtk_container_add (GTK_CONTAINER (priv->grid_documents),
                            GTK_WIDGET (priv->notebook));
-        gtk_paned_pack1 (hpaned, GTK_WIDGET (priv->sidebar), FALSE, FALSE);
-        gtk_paned_add2 (hpaned, contents_vgrid);
-        gtk_widget_show_all (GTK_WIDGET (hpaned));
-        gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (hpaned));
 
         add_actions (window);
 
diff --git a/src/dh-window.ui b/src/dh-window.ui
new file mode 100644
index 00000000..cff68898
--- /dev/null
+++ b/src/dh-window.ui
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.8 -->
+  <menu id="window_menu_simple">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Side Panel</attribute>
+        <attribute name="action">win.show-sidebar</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Print</attribute>
+        <attribute name="action">win.print</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Find</attribute>
+        <attribute name="action">win.find</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Larger Text</attribute>
+        <attribute name="action">win.zoom-in</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">S_maller Text</attribute>
+        <attribute name="action">win.zoom-out</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Normal Size</attribute>
+        <attribute name="action">win.zoom-default</attribute>
+      </item>
+    </section>
+  </menu>
+  <menu id="window_menu_plus_app_menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">New _Window</attribute>
+        <attribute name="action">app.new-window</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Side Panel</attribute>
+        <attribute name="action">win.show-sidebar</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Print</attribute>
+        <attribute name="action">win.print</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Find</attribute>
+        <attribute name="action">win.find</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Larger Text</attribute>
+        <attribute name="action">win.zoom-in</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">S_maller Text</attribute>
+        <attribute name="action">win.zoom-out</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Normal Size</attribute>
+        <attribute name="action">win.zoom-default</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Preferences</attribute>
+        <attribute name="action">app.preferences</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        <attribute name="action">win.show-help-overlay</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Help</attribute>
+        <attribute name="action">app.help</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_About Devhelp</attribute>
+        <attribute name="action">app.about</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Quit</attribute>
+        <attribute name="action">app.quit</attribute>
+      </item>
+    </section>
+  </menu>
+  <template class="DhWindow" parent="GtkApplicationWindow">
+    <property name="can_focus">False</property>
+    <property name="has_focus">False</property>
+    <property name="is_focus">False</property>
+    <child type="titlebar">
+      <object class="GtkHeaderBar" id="header_bar">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="vexpand">False</property>
+        <property name="show_close_button">True</property>
+        <child>
+          <object class="GtkBox" id="box">
+            <property name="visible">True</property>
+            <property name="valign">center</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="linked"/>
+            </style>
+            <child>
+              <object class="GtkButton" id="back_button">
+                <property name="visible">True</property>
+                <property name="valign">center</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Back</property>
+                <property name="action_name">win.go-back</property>
+                <style>
+                  <class name="image-button"/>
+                </style>
+                <child>
+                  <object class="GtkImage" id="back_button_image">
+                    <property name="visible">True</property>
+                    <property name="icon_size">1</property>
+                    <property name="icon_name">go-previous-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton" id="forward_button">
+                <property name="visible">True</property>
+                <property name="valign">center</property>
+                <property name="can_focus">False</property>
+                <property name="tooltip_text" translatable="yes">Forward</property>
+                <property name="action_name">win.go-forward</property>
+                <style>
+                  <class name="image-button"/>
+                </style>
+                <child>
+                  <object class="GtkImage" id="forward_button_image">
+                    <property name="visible">True</property>
+                    <property name="icon_size">1</property>
+                    <property name="icon_name">go-next-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack_type">start</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkMenuButton" id="window_menu_button">
+            <property name="visible">True</property>
+            <property name="valign">center</property>
+            <property name="can_focus">False</property>
+            <property name="menu_model">window_menu_simple</property>
+            <property name="use_popover">True</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="window_menu_image">
+                <property name="visible">True</property>
+                <property name="icon_size">1</property>
+                <property name="icon_name">open-menu-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="new_tab_button">
+            <property name="visible">True</property>
+            <property name="valign">center</property>
+            <property name="can_focus">False</property>
+            <property name="tooltip_text" translatable="yes">New Tab</property>
+            <property name="action_name">win.new-tab</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="new_tab_button_image">
+                <property name="visible">True</property>
+                <property name="icon_size">1</property>
+                <property name="icon_name">tab-new-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkGrid" id="grid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="has_focus">False</property>
+        <property name="is_focus">False</property>
+        <child>
+          <object class="GtkPaned" id="hpaned">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_focus">False</property>
+            <property name="is_focus">False</property>
+            <child>
+              <object class="GtkGrid" id="grid_sidebar">
+                <property name="visible">True</property>
+                <style>
+                  <class name="sidebar"/>
+                </style>
+              </object>
+              <packing>
+               <property name="shrink">False</property>
+             </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid_documents">
+                <property name="visible">True</property>
+                <property name="orientation">vertical</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/src/dh.gresource.xml b/src/dh.gresource.xml
index 78fda590..d59c7663 100644
--- a/src/dh.gresource.xml
+++ b/src/dh.gresource.xml
@@ -11,5 +11,10 @@
   <gresource prefix="/org/gnome/devhelp">
     <file preprocess="xml-stripblanks">dh-assistant.ui</file>
     <file preprocess="xml-stripblanks">dh-preferences.ui</file>
+    <file preprocess="xml-stripblanks">dh-window.ui</file>
+  </gresource>
+  <gresource prefix="/org/gnome/devhelp/gtk">
+    <file preprocess="xml-stripblanks">help-overlay.ui</file>
+    <file preprocess="xml-stripblanks">menus.ui</file>
   </gresource>
 </gresources>
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
new file mode 100644
index 00000000..80eea36c
--- /dev/null
+++ b/src/help-overlay.ui
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <object class="GtkShortcutsWindow" id="help_overlay">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">10</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">General</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;K</property>
+                <property name="title" translatable="yes" context="shortcut window">Focus global 
search</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;F</property>
+                <property name="title" translatable="yes" context="shortcut window">Find in current 
page</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;N</property>
+                <property name="title" translatable="yes" context="shortcut window">Open a new 
window</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;T</property>
+                <property name="title" translatable="yes" context="shortcut window">Open a new tab</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F9</property>
+                <property name="title" translatable="yes" context="shortcut window">Toggle side panel 
visibility</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;alt&gt;Left</property>
+                <property name="title" translatable="yes" context="shortcut window">Go back</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;alt&gt;Right</property>
+                <property name="title" translatable="yes" context="shortcut window">Go forward</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;P</property>
+                <property name="title" translatable="yes" context="shortcut window">Print</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;W</property>
+                <property name="title" translatable="yes" context="shortcut window">Close the current 
window</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Control&gt;Q</property>
+                <property name="title" translatable="yes" context="shortcut window">Close all 
windows</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">Zoom</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;plus</property>
+                <property name="title" translatable="yes" context="shortcut window">Zoom in</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;minus</property>
+                <property name="title" translatable="yes" context="shortcut window">Zoom out</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;0</property>
+                <property name="title" translatable="yes" context="shortcut window">Reset Zoom</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/src/menus.ui b/src/menus.ui
new file mode 100644
index 00000000..a2d53483
--- /dev/null
+++ b/src/menus.ui
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  This file is part of Devhelp.
+
+  Copyright (C) 2010 Imendio AB
+  Copyright (C) 2012 Aleksander Morgado <aleksander gnu org>
+  Copyright (C) 2017, 2018 Sébastien Wilmet <swilmet gnome org>
+
+  Devhelp is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published
+  by the Free Software Foundation, either version 3 of the License,
+  or (at your option) any later version.
+
+  Devhelp is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Devhelp.  If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <!-- The app menu is set manually if needed. -->
+  <menu id="manual-app-menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">New _Window</attribute>
+        <attribute name="action">app.new-window</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Preferences</attribute>
+        <attribute name="action">app.preferences</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        <attribute name="action">win.show-help-overlay</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Help</attribute>
+        <attribute name="action">app.help</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_About</attribute>
+        <attribute name="action">app.about</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Quit</attribute>
+        <attribute name="action">app.quit</attribute>
+      </item>
+    </section>
+  </menu>
+</interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]