Merge lp:~elementary-apps/simple-scan/elementary-headerbar into lp:~simple-scan-team/simple-scan/trunk

Proposed by Danielle Foré
Status: Merged
Merged at revision: 718
Proposed branch: lp:~elementary-apps/simple-scan/elementary-headerbar
Merge into: lp:~simple-scan-team/simple-scan/trunk
Diff against target: 47 lines (+9/-15)
1 file modified
src/ui.vala (+9/-15)
To merge this branch: bzr merge lp:~elementary-apps/simple-scan/elementary-headerbar
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+226623@code.launchpad.net

Description of the change

This branch makes the headerbar show in Pantheon (elementary OS) by using the logic from GNOME Mahjongg (at Robert's suggestion).

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Works for me. This might cause other desktops like XFCE to show the HeaderBar but I don't know what their preference is so we'll find out if they shout out...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ui.vala'
2--- src/ui.vala 2014-07-02 00:06:53 +0000
3+++ src/ui.vala 2014-07-14 00:28:48 +0000
4@@ -1648,20 +1648,14 @@
5 copy_to_clipboard_menuitem.sensitive = true;
6 }
7
8- private bool has_app_menu (Gtk.Application app)
9+ private bool shell_shows_menubar
10 {
11- /* We have three cases:
12- * - GNOME 3: show-app-menu true, show-menubar false -> use the app menu
13- * - Unity, OSX: show-app-menu and show-menubar true -> use the normal menu
14- * - Other WM, Windows: show-app-menu and show-menubar false -> use the normal menu
15- */
16- var gtk_settings = Gtk.Settings.get_default ();
17-
18- bool show_app_menu = false;
19- bool show_menubar = true;
20- gtk_settings.get ("gtk-shell-shows-app-menu", &show_app_menu, "gtk-shell-shows-menubar", &show_menubar, null);
21-
22- return show_app_menu && !show_menubar;
23+ get
24+ {
25+ bool shell_shows_menubar;
26+ Gtk.Settings.get_default ().get ("gtk-shell-shows-menubar", out shell_shows_menubar);
27+ return shell_shows_menubar;
28+ }
29 }
30
31 private void load ()
32@@ -1672,7 +1666,7 @@
33
34 var app = Application.get_default () as Gtk.Application;
35
36- if (has_app_menu (app))
37+ if (!shell_shows_menubar)
38 {
39 app.add_action_entries (action_entries, this);
40
41@@ -2165,4 +2159,4 @@
42
43 return true;
44 }
45-}
46+}
47\ No newline at end of file

Subscribers

People subscribed via source and target branches