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



commit 3d712094593674d1629a96f40502913e73b3466d
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 02c5515..785732d 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]