on xenial help sign in
reverted rebase
2ec7b98Nick Dedekind
qml/ApplicationMenus/MenuBar.qml−1
@@ -119,7 +119,6 @@ Item {
119 function show() {
119 function show() {
120 if (!__popup) {
120 if (!__popup) {
121 __popup = menuComponent.createObject(root, { objectName: visualItem.objectName + "-menu" });
121 __popup = menuComponent.createObject(root, { objectName: visualItem.objectName + "-menu" });
122− __popup.childActivated.connect(dismiss);
123 // force the current item to be the newly popped up menu
122 // force the current item to be the newly popped up menu
124 } else {
123 } else {
125 __popup.show();
124 __popup.show();
qml/ApplicationMenus/MenuPopup.qml+5−19
@@ -26,8 +26,6 @@ UbuntuShape {
26 objectName: "menu"
26 objectName: "menu"
27 backgroundColor: theme.palette.normal.overlay
27 backgroundColor: theme.palette.normal.overlay
28
28
29− signal childActivated()
30−
31 property alias unityMenuModel: repeater.model
29 property alias unityMenuModel: repeater.model
32
30
33 function show() {
31 function show() {
@@ -276,22 +274,16 @@ UbuntuShape {
276 return mapToItem(container, 0, y).y;
274 return mapToItem(container, 0, y).y;
277 })
275 })
278 });
276 });
279− popup.retreat.connect(function() {
280− popup.destroy();
281− popup = null;
282− menuItem.forceActiveFocus();
283− });
284− popup.childActivated.connect(function() {
285− popup.destroy();
286− popup = null;
287− root.childActivated();
288− });
289 } else if (popup) {
277 } else if (popup) {
290 popup.visible = true;
278 popup.visible = true;
291 }
279 }
280+ popup.retreat.connect(function() {
281+ popup.destroy();
282+ popup = null;
283+ menuItem.forceActiveFocus();
284+ })
292 } else {
285 } else {
293 root.unityMenuModel.activate(__ownIndex);
286 root.unityMenuModel.activate(__ownIndex);
294− root.childActivated();
295 }
287 }
296 }
288 }
297
289
@@ -407,7 +399,6 @@ UbuntuShape {
407
399
408 property var unityMenuModel: null
400 property var unityMenuModel: null
409 signal retreat()
401 signal retreat()
410− signal childActivated()
411
402
412 Binding {
403 Binding {
413 target: item
404 target: item
@@ -423,11 +414,6 @@ UbuntuShape {
423
414
424 Keys.onLeftPressed: retreat()
415 Keys.onLeftPressed: retreat()
425
416
426− Connections {
427− target: item
428− onChildActivated: childActivated();
429− }
430−
431 Component.onCompleted: item.select(0);
417 Component.onCompleted: item.select(0);
432 onVisibleChanged: if (visible) { item.select(0); }
418 onVisibleChanged: if (visible) { item.select(0); }
433 }
419 }
tests/qmltests/ApplicationMenus/tst_MenuBar.qml−35
@@ -180,41 +180,6 @@ Item {
180 tryCompare(priv, "currentItem", menuItem);
180 tryCompare(priv, "currentItem", menuItem);
181 }
181 }
182
182
183− function test_menuActivateClosesMenu() {
184− menuBackend.modelData = appMenuData.generateTestData(3,3,0,0,"menu");
185− var priv = findInvisibleChild(menuBar, "d");
186−
187− var menuItem = findChild(menuBar, "menuBar-item0");
188− menuItem.show();
189− compare(priv.currentItem, menuItem, "CurrentItem should be set to item 0");
190− compare(priv.currentItem.popupVisible, true, "Popup should be visible");
191−
192− var actionItem = findChild(menuBar, "menuBar-item0-menu-item0-actionItem");
193− mouseClick(actionItem);
194− compare(priv.currentItem, null, "CurrentItem should be null");
195− }
196−
197− function test_subMenuActivateClosesMenu() {
198− menuBackend.modelData = appMenuData.generateTestData(3,4,1,0,"menu");
199− var priv = findInvisibleChild(menuBar, "d");
200−
201− var menuItem = findChild(menuBar, "menuBar-item0");
202− menuItem.show();
203− compare(priv.currentItem, menuItem, "CurrentItem should be set to item 0");
204− compare(priv.currentItem.popupVisible, true, "Popup should be visible");
205−
206− var actionItem = findChild(menuBar, "menuBar-item0-menu-item0-actionItem");
207− mouseClick(actionItem);
208−
209− actionItem = findChild(menuBar, "menuBar-item0-menu-item0-menu-item0-actionItem");
210− mouseClick(actionItem);
211−
212− actionItem = findChild(menuBar, "menuBar-item0-menu-item0-menu-item0-menu-item0-actionItem");
213− mouseClick(actionItem);
214−
215− compare(priv.currentItem, null, "CurrentItem should be null");
216− }
217−
218 function test_openAppMenuShortcut() {
183 function test_openAppMenuShortcut() {
219 var priv = findInvisibleChild(menuBar, "d");
184 var priv = findInvisibleChild(menuBar, "d");
220
185