Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r5c21e83a3fdc897cb99ac62e1cec0213f411cd73 -r73d6d02c19467735e92f7c451ca5d3b47a2a90e4 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 5c21e83a3fdc897cb99ac62e1cec0213f411cd73) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 73d6d02c19467735e92f7c451ca5d3b47a2a90e4) @@ -38,7 +38,6 @@ property bool hasLogo : false property int currentIndex : 0 property string currentTitle : titles[currentIndex] - readonly property var currentItem : _private.items[currentIndex] /*! * \brief Emits when a menu item pressed @@ -47,7 +46,12 @@ signal itemPressed(int vIndex) onItemPressed: { currentIndex = vIndex - _highlightRect.x = _private.items[vIndex].x + let itemAt = _repeater.itemAt(vIndex) + if (itemAt) + _highlightRect.x = itemAt.x + else { + _highlightRect.x = _rightTouchRect.x + } } onCurrentIndexChanged: itemPressed(currentIndex) @@ -60,7 +64,6 @@ readonly property var repeaterTitles: hasRightText ? titles.slice(0,titles.length - 1) : titles readonly property string rightText : titles.length ? titles[titles.length - 1] : "" readonly property int partitionWidth: _row.width / ( _private.repeaterTitles.length * 2 + 1) - property var items : [] } /*! type:int @@ -111,7 +114,6 @@ onPressed: { itemPressed(index) } - Component.onCompleted: _private.items[index] = _touchRect } } } @@ -137,7 +139,6 @@ } anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - Component.onCompleted: _private.items[index] = _rightTouchRect } // normal text bottom highlighter @@ -148,7 +149,7 @@ height: 10 radius: 10 anchors.bottom: parent.bottom - anchors.bottomMargin: -5 + anchors.bottomMargin: -(height / 2) Behavior on x { PropertyAnimation { /*duration: 500; easing.type: Easing.OutBounce*/ } } }