Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r45c7fe06db813c13eaec0bb5f8bfc2135063ea58 -rd4befd2d92ee54b57de33867a1e2517cafdd89d3 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 45c7fe06db813c13eaec0bb5f8bfc2135063ea58) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision d4befd2d92ee54b57de33867a1e2517cafdd89d3) @@ -30,8 +30,18 @@ Item { id: _root property variant titles: [] - signal itemPressed(int index) + /*! + * \brief Emits when a menu item pressed + * \param vIndex is the index of the pressed item + */ + signal itemPressed(int vIndex) + /*! type:int + * this property holds the width of each partition + * regarding to the menuitem count and menu width + */ + property int partitionWidth: _row.width / (titles.length*2 + 1) + height: Variables.mainMenuHeight anchors { right : parent.right @@ -44,8 +54,8 @@ color: Colors.backgroundMainMenu } + Row { id: _row - property int partitionWidth: _row.width / (titles.length*2 + 1) anchors.fill: parent spacing : partitionWidth leftPadding : partitionWidth @@ -54,7 +64,7 @@ Repeater { id: _repeater model: titles TouchRect { id : _treatmentRect - width: _row.partitionWidth + width: partitionWidth height: parent.height text.text: modelData border.width: 0 @@ -68,8 +78,8 @@ Rectangle { id : _highlightRect color: Colors.backgroundButton - width: _row.partitionWidth - x : _row.partitionWidth + width: partitionWidth + x : partitionWidth height: 10 radius: 10 anchors.bottom: parent.bottom Index: sources/gui/qml/main.qml =================================================================== diff -u -r45c7fe06db813c13eaec0bb5f8bfc2135063ea58 -rd4befd2d92ee54b57de33867a1e2517cafdd89d3 --- sources/gui/qml/main.qml (.../main.qml) (revision 45c7fe06db813c13eaec0bb5f8bfc2135063ea58) +++ sources/gui/qml/main.qml (.../main.qml) (revision d4befd2d92ee54b57de33867a1e2517cafdd89d3) @@ -66,11 +66,10 @@ // 3 - Footer MainMenu { id: _mainMenu titles: [ qsTr("Treatment") , qsTr("Manager") , qsTr("Settings") ] - //titles: [ "1", "2", "3", "4", "5" ] onItemPressed: { - _treatmentStack .visible = index == 0; - _mansagerStack .visible = index == 1; - _settingsStack .visible = index == 2; + _treatmentStack .visible = vIndex == 0; + _mansagerStack .visible = vIndex == 1; + _settingsStack .visible = vIndex == 2; } }