[atomix] Fixes #7: Implemented proper appmenu without hacks



commit 2eb237aaad0b2859387e92f2c61374a92e9d0545
Author: Robert Roth <robert roth off gmail com>
Date:   Mon Jun 4 20:39:45 2018 +0300

    Fixes #7: Implemented proper appmenu without hacks

 data/ui/menu.ui |  4 ++--
 src/main.c      | 25 ++++++++++---------------
 2 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/data/ui/menu.ui b/data/ui/menu.ui
index 973b31a..e557695 100644
--- a/data/ui/menu.ui
+++ b/data/ui/menu.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <menu id="appmenu">
+  <menu id="app-menu">
     <section>
       <item>
         <attribute name="label" translatable="yes">New Game</attribute>
@@ -48,4 +48,4 @@
       </item>
     </section>
   </menu>
-</interface>
\ No newline at end of file
+</interface>
diff --git a/src/main.c b/src/main.c
index 67202d1..3a71983 100644
--- a/src/main.c
+++ b/src/main.c
@@ -118,15 +118,15 @@ static void verb_HelpAbout_cb (GSimpleAction *action, GVariant *variant, gpointe
 
 
   gtk_show_about_dialog(GTK_WINDOW(app->mainwin),
-                                       "program-name", _("Atomix"),
-            "logo-icon-name", "atomix",
-                                       "version", VERSION,
-                                       "comments", _("A puzzle game about atoms and molecules"),
-            "website", "https://wiki.gnome.org/Apps/Atomix";,
-                                       "authors", authors,
-                                       "artists", artists,
-                                       "translator_credits", _("translator-credits"),
-                                       NULL);
+                        "program-name", _("Atomix"),
+                        "logo-icon-name", "atomix",
+                        "version", VERSION,
+                        "comments", _("A puzzle game about atoms and molecules"),
+                        "website", "https://wiki.gnome.org/Apps/Atomix";,
+                        "authors", authors,
+                        "artists", artists,
+                        "translator_credits", _("translator-credits"),
+                        NULL);
 }
 
 static gboolean on_app_destroy_event (GtkWidget *widget, GdkEvent *event,
@@ -647,14 +647,9 @@ static AtomixApp *create_gui (GApplication *app_instance)
   headerbar = GTK_WIDGET (gtk_builder_get_object(builder, "headerbar"));
   gtk_application_add_window (GTK_APPLICATION (app->app_instance), GTK_WINDOW (app->mainwin));
   gtk_window_set_titlebar (GTK_WINDOW (app->mainwin), headerbar);
-  GMenu * menu = G_MENU (gtk_builder_get_object (builder, "appmenu"));
+  GMenu * menu = G_MENU (gtk_builder_get_object (builder, "app-menu"));
   gtk_application_set_app_menu (GTK_APPLICATION (app->app_instance), G_MENU_MODEL (menu));
 
-  // TODO find out why appmenu isn't shown without this
-  g_object_set (gtk_widget_get_settings (headerbar),
-                "gtk-shell-shows-app-menu", FALSE,
-                NULL);
-
   g_object_unref (builder);
 
   return app;


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