[gedit] Use gtk's utility to check whether we have an app menu
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use gtk's utility to check whether we have an app menu
- Date: Tue, 29 Jul 2014 07:56:19 +0000 (UTC)
commit a5201f28dd5f44fc0e1f5db2420d651f04afbf28
Author: Paolo Borelli <pborelli gnome org>
Date: Tue Jul 29 09:55:33 2014 +0200
Use gtk's utility to check whether we have an app menu
gedit/gedit-app.c | 23 +----------------------
1 files changed, 1 insertions(+), 22 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index f29c76c..6edb091 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -385,27 +385,6 @@ extension_removed (PeasExtensionSet *extensions,
gedit_app_activatable_deactivate (GEDIT_APP_ACTIVATABLE (exten));
}
-static gboolean
-gedit_app_has_app_menu (GeditApp *app)
-{
- GtkSettings *gtk_settings;
- gboolean show_app_menu;
- gboolean show_menubar;
-
- /* We have three cases:
- * - GNOME 3: show-app-menu true, show-menubar false -> use the app menu
- * - Unity, OSX: show-app-menu and show-menubar true -> use the normal menu
- * - Other WM, Windows: show-app-menu and show-menubar false -> use the normal menu
- */
- gtk_settings = gtk_settings_get_default ();
- g_object_get (G_OBJECT (gtk_settings),
- "gtk-shell-shows-app-menu", &show_app_menu,
- "gtk-shell-shows-menubar", &show_menubar,
- NULL);
-
- return show_app_menu && !show_menubar;
-}
-
static void
load_accels (void)
{
@@ -541,7 +520,7 @@ gedit_app_startup (GApplication *application)
app);
/* menus */
- if (gedit_app_has_app_menu (app))
+ if (gtk_application_prefers_app_menu (GTK_APPLICATION (app)))
{
app->priv->window_menu = get_menu_model (app, "gear_menu_withappmenu");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]