on xenial help sign in
Immediate recognition of popup on Alt mnemonic
94ea5dcNick Dedekind
qml/ApplicationMenus/MenuBar.qml+10−8
@@ -93,19 +93,29 @@ Item {
93 function show() {
93 function show() {
94 if (!__popup) {
94 if (!__popup) {
95 __popup = menuComponent.createObject(root, { objectName: visualItem.objectName + "-menu" });
95 __popup = menuComponent.createObject(root, { objectName: visualItem.objectName + "-menu" });
96+ // force the current item to be the newly popped up menu
96 } else {
97 } else {
97 __popup.visible = true;
98 __popup.visible = true;
98 }
99 }
100+ d.currentItem = visualItem;
99 }
101 }
100 function hide() {
102 function hide() {
101 if (__popup) {
103 if (__popup) {
102 __popup.visible = false;
104 __popup.visible = false;
105+
106+ if (d.currentItem === visualItem) {
107+ d.currentItem = null;
108+ }
103 }
109 }
104 }
110 }
105 function dismiss() {
111 function dismiss() {
106 if (__popup) {
112 if (__popup) {
107 __popup.destroy();
113 __popup.destroy();
108 __popup = null;
114 __popup = null;
115+
116+ if (d.currentItem === visualItem) {
117+ d.currentItem = null;
118+ }
109 }
119 }
110 }
120 }
111
121
@@ -126,14 +136,6 @@ Item {
126 }
136 }
127 }
137 }
128
138
129− onPopupVisibleChanged: {
130− if (popupVisible) {
131− d.currentItem = visualItem;
132− } else if (d.currentItem === visualItem) {
133− d.currentItem = null;
134− }
135− }
136−
137 RowLayout {
139 RowLayout {
138 id: column
140 id: column
139 spacing: units.gu(1)
141 spacing: units.gu(1)