Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r9cf3722af44d68c46b511c2be8c945ffd3bc3873 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 9cf3722af44d68c46b511c2be8c945ffd3bc3873) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -32,6 +32,8 @@ property int titlePixelSize : 40 property color backgroundColor : Colors.backgroundMainMenu property int highlightHeight : 10 + property bool isMainMenu : false + property bool isMainTreatment : false width : parent.width height : Variables.mainMenuHeight @@ -45,21 +47,27 @@ signal itemPressed(int vIndex) - function updateModel(list) { - _model.clear() - _model.append(list) - _listView.currentIndex = 0 + ListModel { id: _mainTreatmentModel + ListElement { text: qsTr("Treatment") } + ListElement { text: qsTr("Trends") } + ListElement { text: qsTr("Heparin") } } - ListModel { id: _model } + ListModel { id: _mainMenuModel + ListElement { text: qsTr("Treatment") } + ListElement { text: qsTr("Prescriptions") } + ListElement { text: qsTr("Settings") } + } ListView { id: _listView property alias index : _listView.currentIndex anchors.fill : parent anchors.leftMargin : 30 anchors.rightMargin : anchors.leftMargin - model : _model + model : isMainMenu ? _mainMenuModel : + isMainTreatment ? _mainTreatmentModel : + null currentIndex : 0 highlightFollowsCurrentItem : true highlightMoveDuration : 500 @@ -79,7 +87,7 @@ anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom - bottomMargin: -(height / 2) + bottomMargin: (height / 2) * -1 } height: _root.highlightHeight width: parent.width / 2 @@ -92,7 +100,6 @@ objectName : "delegateControl" width : ListView.view.count ? ListView.view.width / ListView.view.count : 0 height : ListView.view.height - visible : model.visible TouchRect { id : _touchRect objectName: "_touchRect" + index