[gedit/wip/3.14-osx: 16/18] [osx] Use menubar as window menu if it exists



commit f325bd0394a12a874f8fa86c7965ea9d1b208483
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Fri Aug 22 10:25:29 2014 +0200

    [osx] Use menubar as window menu if it exists

 gedit/gedit-app.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index d0258ef..aa43fe7 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -522,7 +522,17 @@ gedit_app_startup (GApplication *application)
                                         app);
 
        /* menus */
-       app->priv->window_menu = get_menu_model (app, "gear-menu");
+       app->priv->window_menu = gtk_application_get_menubar (GTK_APPLICATION (app));
+
+       if (app->priv->window_menu == NULL)
+       {
+               app->priv->window_menu = get_menu_model (app, "gear-menu");
+       }
+       else
+       {
+               g_object_ref (app->priv->window_menu);
+       }
+
        app->priv->notebook_menu = get_menu_model (app, "notebook-menu");
        app->priv->tab_width_menu = get_menu_model (app, "tab-width-menu");
        app->priv->line_col_menu = get_menu_model (app, "line-col-menu");


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