Merge lp:~gue5t/midori/appmenu-menubar-binding into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: Cris Dywan
Approved revision: 7013
Merged at revision: 7013
Proposed branch: lp:~gue5t/midori/appmenu-menubar-binding
Merge into: lp:midori
Diff against target: 14 lines (+3/-2)
1 file modified
midori/midori-window.vala (+3/-2)
To merge this branch: bzr merge lp:~gue5t/midori/appmenu-menubar-binding
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+267463@code.launchpad.net

Commit message

fix property binding to ensure that exactly one of appmenu button and menubar is always visible

Description of the change

As of a recent commit, the appmenu icon is always visible in the toolbar. This is because the property binding intended to control its visibility was only set if the *window*'s name was "CompactMenu", rather than checking if the action being created by the window was named that.

In addition, the binding needed to invert the boolean to ensure that if the menubar is shown, the appmenu is *not* visible. This patch makes it work as intended.

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Good catch. I completely didn't realize that it would've been using the window's name.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-window.vala'
2--- midori/midori-window.vala 2015-07-07 23:03:47 +0000
3+++ midori/midori-window.vala 2015-08-10 00:01:41 +0000
4@@ -90,8 +90,9 @@
5 toolitem.is_important = true;
6 toolitem.get_child ().button_press_event.connect ((event) => {
7 return event.button == 3 && context_menu (toolitem, action); });
8- if (name == "CompactMenu")
9- bind_property ("show-menubar", toolitem, "visible");
10+ if (action.name == "CompactMenu")
11+ bind_property ("show-menubar", toolitem, "visible",
12+ BindingFlags.DEFAULT|BindingFlags.INVERT_BOOLEAN);
13 return toolitem;
14 }
15

Subscribers

People subscribed via source and target branches

to all changes: