@@ -276,6 +276,79 @@ UbuntuShape {
280+ id: separatorComponent
281+ ListItems.ThinDivider {
282+ // Parent will be loader
283+ objectName: parent.objectName + "-separator"
284+ implicitHeight: units.dp(2)
289+ id: menuItemComponent
291+ // Parent will be loader
293+ menuData: parent.__menuData
294+ objectName: parent.objectName + "-actionItem"
296+ width: MathUtils.clamp(implicitWidth, d.__minimumWidth, d.__maximumWidth)
298+ action.onTriggered: {
299+ submenuHoverTimer.stop();
301+ d.currentItem = parent;
305+ var model = root.unityMenuModel.submenu(__ownIndex);
306+ popup = submenuComponent.createObject(focusScope, {
307+ objectName: parent.objectName + "-",
308+ unityMenuModel: model,
309+ substractWidth: true,
310+ desiredX: Qt.binding(function() { return root.width }),
311+ desiredY: Qt.binding(function() {
312+ var dummy = listView.contentY; // force a recalc on contentY change.
313+ return mapToItem(container, 0, y).y;
316+ popup.retreat.connect(function() {
319+ menuItem.forceActiveFocus();
321+ popup.childActivated.connect(function() {
324+ root.childActivated();
327+ popup.visible = true;
330+ root.unityMenuModel.activate(__ownIndex);
331+ root.childActivated();
337+ onCurrentIndexChanged: {
338+ if (popup && d.currentIndex != __ownIndex) {
339+ popup.visible = false;
279 ColumnLayout {
352 ColumnLayout {
280 id: menuColumn
353 id: menuColumn
281 spacing: 0
354 spacing: 0
@@ -289,6 +362,8 @@ UbuntuShape {
289 id: loader
362 id: loader
290 objectName: root.objectName + "-item" + __ownIndex
363 objectName: root.objectName + "-item" + __ownIndex
365+ property Item popup: null
366+ property var __menuData: model
292 property int __ownIndex: index
367 property int __ownIndex: index
293 property bool __isSeparator: model.isSeparator
368 property bool __isSeparator: model.isSeparator
@@ -301,80 +376,7 @@ UbuntuShape {
301 return menuItemComponent;
376 return menuItemComponent;
304− property Item popup: null
306 Layout.fillWidth: true
379 Layout.fillWidth: true
309− id: menuItemComponent
313− objectName: loader.objectName + "-actionItem"
315− width: MathUtils.clamp(implicitWidth, d.__minimumWidth, d.__maximumWidth)
317− action.onTriggered: {
318− submenuHoverTimer.stop();
320− d.currentItem = loader;
324− var model = root.unityMenuModel.submenu(__ownIndex);
325− popup = submenuComponent.createObject(focusScope, {
326− objectName: loader.objectName + "-",
327− unityMenuModel: model,
328− substractWidth: true,
329− desiredX: Qt.binding(function() { return root.width }),
330− desiredY: Qt.binding(function() {
331− var dummy = listView.contentY; // force a recalc on contentY change.
332− return mapToItem(container, 0, y).y;
335− popup.retreat.connect(function() {
338− menuItem.forceActiveFocus();
340− popup.childActivated.connect(function() {
343− root.childActivated();
346− popup.visible = true;
349− root.unityMenuModel.activate(__ownIndex);
350− root.childActivated();
356− onCurrentIndexChanged: {
357− if (popup && d.currentIndex != __ownIndex) {
358− popup.visible = false;
372− id: separatorComponent
373− ListItems.ThinDivider {
374− objectName: loader.objectName + "-separator"
375− implicitHeight: units.dp(2)