@@ -40,27 +40,32 @@ UbuntuShape {
40 readonly property real __maximumWidth: Screen.width * 0.7
40 readonly property real __maximumWidth: Screen.width * 0.7
41 readonly property real __maximumHeight: Screen.height * 0.7
41 readonly property real __maximumHeight: Screen.height * 0.7
45+ focusScope.forceActiveFocus();
50+ d.currentItem = null;
43 function select(index) {
53 function select(index) {
44 d.select(index)
54 d.select(index)
47 function reset() {
57 function reset() {
48 d.currentItem = null;
58 d.currentItem = null;
51 function dismiss() {
62 function dismiss() {
52− d.dismissAll()
63+ d.dismissAll();
55 implicitWidth: container.width
66 implicitWidth: container.width
56 implicitHeight: MathUtils.clamp(listView.contentHeight, __ajustedMinimumHeight, __maximumHeight)
67 implicitHeight: MathUtils.clamp(listView.contentHeight, __ajustedMinimumHeight, __maximumHeight)
60− d.currentItem = null;
64 MenuNavigator {
69 MenuNavigator {
66 objectName: "d"
71 objectName: "d"
@@ -85,7 +90,7 @@ UbuntuShape {
88− FocusScope {
93+ Item {
89 id: focusScope
94 id: focusScope
90 anchors.fill: parent
95 anchors.fill: parent
91 focus: visible
96 focus: visible
@@ -250,7 +255,7 @@ UbuntuShape {
250 } else if (popup) {
255 } else if (popup) {
251 popup.visible = true;
256 popup.visible = true;
253− popup.dismiss.connect(function() {
258+ popup.retreat.connect(function() {
254 popup.destroy();
259 popup.destroy();
255 popup = null;
260 popup = null;
256 menuItem.forceActiveFocus();
261 menuItem.forceActiveFocus();
@@ -267,6 +272,12 @@ UbuntuShape {
267 popup.visible = false;
272 popup.visible = false;
@@ -325,7 +336,7 @@ UbuntuShape {
325 source: "MenuPopup.qml"
336 source: "MenuPopup.qml"
327 property var unityMenuModel: null
338 property var unityMenuModel: null
328− signal dismiss()
339+ signal retreat()
330 Binding {
341 Binding {
331 target: item
342 target: item
@@ -339,12 +350,7 @@ UbuntuShape {
339 value: submenuLoader.objectName + "menu"
350 value: submenuLoader.objectName + "menu"
344− onDismissAll: submenuLoader.dismiss()
347− Keys.onLeftPressed: dismiss()
353+ Keys.onLeftPressed: retreat()
349 Component.onCompleted: item.select(0);
355 Component.onCompleted: item.select(0);
350 onVisibleChanged: if (visible) { item.select(0); }
356 onVisibleChanged: if (visible) { item.select(0); }