Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r0808e668ca656c86185c3fa69e4a70dbdb4192c9 -rbce1e6f584c921c9fa6945204ed1e1d38021fbc8 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 0808e668ca656c86185c3fa69e4a70dbdb4192c9) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision bce1e6f584c921c9fa6945204ed1e1d38021fbc8) @@ -34,12 +34,21 @@ property int highlightHeight : 10 property bool isMainMenu : false property bool isMainTreatment : false + readonly property int currentScreen : isMainTreatment ? _mainTreatmentModel.get(index).screen : 0 + property color statusColor : Colors.transparent width : parent.width height : Variables.mainMenuHeight color : _root.backgroundColor clip : true + enum TreatmentScreen { + Treatment = 0, + Trends = 1, + Heparin = 2, + HDF = 3 + } + gradient: Gradient { GradientStop { position: 0.2; color: Qt.lighter(Colors.backgroundMain, 1.2) } GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } @@ -48,15 +57,16 @@ signal itemPressed(int vIndex) ListModel { id: _mainTreatmentModel - ListElement { text: qsTr("Treatment") } - ListElement { text: qsTr("Trends") } - ListElement { text: qsTr("Heparin") } + ListElement { text: qsTr("Treatment"); visible: true; screen: 0 } // MainMenu.Treatment + ListElement { text: qsTr("Trends"); visible: true; screen: 1 } // MainMenu.Trends + ListElement { text: qsTr("Heparin"); visible: true; /*TODO: vSettings.heparinSyringePump */ screen: 2 } // MainMenu.Heparin + ListElement { text: qsTr("HDF"); visible: true; screen: 3 } // MainMenu.HDF } ListModel { id: _mainMenuModel - ListElement { text: qsTr("Treatment") } - ListElement { text: qsTr("Prescriptions") } - ListElement { text: qsTr("Settings") } + ListElement { text: qsTr("Treatment") ; visible: true } + ListElement { text: qsTr("Prescriptions") ; visible: true } + ListElement { text: qsTr("Settings") ; visible: true } } ListView { id: _listView @@ -89,17 +99,18 @@ bottom: parent.bottom bottomMargin: (height / 2) * -1 } - height: _root.highlightHeight - width: parent.width / 2 - radius: 10 - color: Colors.backgroundButtonSelect + height : _root.highlightHeight + width : parent.width / 2 + radius : 10 + color : Colors.backgroundButtonSelect } } delegate: Item { id: _delegateControl objectName : "delegateControl" - width : ListView.view.count ? ListView.view.width / ListView.view.count : 0 + width : ListView.view.count ? model.visible ? ListView.view.width / ListView.view.count : 0 : 0 height : ListView.view.height + visible : model.visible TouchRect { id : _touchRect objectName: "_touchRect" + index @@ -109,6 +120,21 @@ border.width: 0 pixelSize : titlePixelSize + Rectangle { id: _heparinStatus + anchors { + left : parent.left + leftMargin : Variables.defaultMargin * 2 + top : parent.top + topMargin : 10 + } + + height : 15 + width : height + radius : height + visible : _root.isMainTreatment && model.screen === MainMenu.Heparin + color : _root.statusColor + } + onPressed: { if (_listView.currentIndex !== index) { _listView.currentIndex = index