Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r89be2d248cac3f748b704cd62408cf8911991039 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 89be2d248cac3f748b704cd62408cf8911991039) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -25,10 +25,11 @@ MouseArea { id: _mouseArea anchors.fill : parent - // TODO: disable this later. this is only for diagnostic purpose. property real lastClickTime: 0 property int doubleClickThreshold: 500 // ms + // had to implement my own double click because the onDoubleClicked was not user friednly for touch. + // a 500 ms threshold between clicks has bee added onClicked : { const now = Date.now() if (now - _mouseArea.lastClickTime < _mouseArea.doubleClickThreshold) { @@ -131,8 +132,16 @@ titlePixelSize : 32 backgroundColor : Colors.transparent highlightHeight : 15 + model : _model isMainTreatment : true onHiddenChanged: { if (hidden) { index = 0 } } + + ListModel { id: _model + 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; screen: 2 } // MainMenu.Heparin + ListElement { text: qsTr("HDF"); visible: false; screen: 3 } // MainMenu.HDF + } } Row { id: _headerButtonRow Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r81aec0b1316a43c46f8c27c773d8f95e695ec273 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 81aec0b1316a43c46f8c27c773d8f95e695ec273) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -27,16 +27,14 @@ Rectangle { id: _root property alias index : _listView.currentIndex + property alias model : _listView.model property bool hidden : false property bool disable : false property int titlePixelSize : 40 property color backgroundColor : Colors.backgroundMainMenu property int highlightHeight : 10 - property bool isMainMenu : false property bool isMainTreatment : false - property bool isDiagnostics : false - - readonly property int currentScreen : isMainTreatment ? _mainTreatmentModel.get(index).screen : 0 + readonly property int currentScreen : isMainTreatment ? model.get(index).screen : 0 property color statusColor : Colors.transparent width : parent.width @@ -58,35 +56,12 @@ signal itemPressed(int vIndex) - ListModel { id: _mainTreatmentModel - 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; screen: 2 } // MainMenu.Heparin - ListElement { text: qsTr("HDF"); visible: false; screen: 3 } // MainMenu.HDF - } - - ListModel { id: _mainMenuModel - ListElement { text: qsTr("Treatment") ; visible: true } - ListElement { text: qsTr("Prescriptions") ; visible: true } - ListElement { text: qsTr("Settings") ; visible: true } - } - - ListModel { id: _diagnosticsModel - ListElement { text: qsTr("TD & Blood Handling") ; visible: true } - ListElement { text: qsTr("DD") ; visible: true } - ListElement { text: qsTr("FP") ; visible: true } - } - ListView { id: _listView property alias index : _listView.currentIndex anchors.fill : parent anchors.leftMargin : 30 anchors.rightMargin : anchors.leftMargin - model : isMainMenu ? _mainMenuModel : - isMainTreatment ? _mainTreatmentModel : - isDiagnostics ? _diagnosticsModel : - null currentIndex : 0 highlightFollowsCurrentItem : true highlightMoveDuration : 500 Index: sources/gui/qml/components/SDCInfo.qml =================================================================== diff -u -rb8a9627cf291b564b0fc1570f9c0a97fa6873035 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/components/SDCInfo.qml (.../SDCInfo.qml) (revision b8a9627cf291b564b0fc1570f9c0a97fa6873035) +++ sources/gui/qml/components/SDCInfo.qml (.../SDCInfo.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -7,32 +7,6 @@ import "qrc:/globals" Item { id: _root - - component SDInfoItem: Item { - width : _sdInfoText.contentWidth - height : 20 - - property alias color : _sdCircle.color - property alias text : _sdInfoText.text - - Rectangle { id: _sdCircle - anchors.right : _sdInfoText.left - anchors.rightMargin : Variables.defaultMargin - width : 12 - height : width - radius : height - } - - Text { id: _sdInfoText - anchors { - right : parent.right - verticalCenter : _sdCircle.verticalCenter - } - color : "grey" - font.pixelSize : Fonts.fontPixelTouchAreaTitle - } - } - Text { id: _sdCardText anchors.top : parent.top anchors.left : parent.left @@ -75,15 +49,34 @@ .arg(("%1 %2") .arg(Variables.sizeConverted( _GuiView.sdTotal, 1000, 3)) .arg(qsTr("MB"))) } - SDInfoItem { id: _sdUsedContainer + Item { id: _sdUsedContainer anchors { bottom : _progress.top bottomMargin: _sdInfo.anchors.topMargin right : _progress.right } - color : Colors.highlightProgressBar - text : ("%1 %2 %3") .arg(Variables.sizeConverted( _GuiView.sdTotal - _GuiView.sdAvail, 1000, 3)) - .arg(qsTr("MB")) - .arg(qsTr("Used")) + width : _sdInfoText.contentWidth + height : 20 + + Rectangle { id: _sdCircle + anchors.right : _sdInfoText.left + anchors.rightMargin : Variables.defaultMargin + color : Colors.highlightProgressBar + width : 12 + height : width + radius : height + } + + Text { id: _sdInfoText + anchors { + right : parent.right + verticalCenter : _sdCircle.verticalCenter + } + color : "grey" + font.pixelSize : Fonts.fontPixelTouchAreaTitle + text : ("%1 %2 %3") .arg(Variables.sizeConverted( _GuiView.sdTotal - _GuiView.sdAvail, 1000, 3)) + .arg(qsTr("MB")) + .arg(qsTr("Used")) + } } } Index: sources/gui/qml/compounds/SettingsSlider.qml =================================================================== diff -u -rb8a9627cf291b564b0fc1570f9c0a97fa6873035 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/compounds/SettingsSlider.qml (.../SettingsSlider.qml) (revision b8a9627cf291b564b0fc1570f9c0a97fa6873035) +++ sources/gui/qml/compounds/SettingsSlider.qml (.../SettingsSlider.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -10,14 +10,12 @@ height : Variables.contentHeight property alias value : _slider.value - property alias valueText : _value.text property alias iconImage : _image.source property alias slider : _slider readonly property color sliderBkgndColor: Colors.dialogShadowColor readonly property color sliderColor : Colors.highlightProgressBar readonly property color valueColor : Colors.dialogValueColor - readonly property var valueFont : Qt.font ({ pixelSize: 28, weight: Font.DemiBold }) readonly property int sliderMargins : Variables.defaultMargin * 3.5 // margins added to visible background to make a larger hitbox readonly property int hitboxMargins : Variables.defaultMargin * -2 // negative margins added to create larger hitbox for touch @@ -31,22 +29,11 @@ } } - Text { id: _value - anchors { - right : parent.right - verticalCenter : parent.verticalCenter - } - color : _root.valueColor - font : _root.valueFont - width : 43 - horizontalAlignment : Text.AlignHCenter - } - Slider { id: _slider anchors { left : _image.right leftMargin : _root.hitboxMargins - right : _value.left + right : parent.right rightMargin : _root.hitboxMargins verticalCenter : parent.verticalCenter } Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml =================================================================== diff -u -r81aec0b1316a43c46f8c27c773d8f95e695ec273 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml (.../DiagnosticsSwipe.qml) (revision 81aec0b1316a43c46f8c27c773d8f95e695ec273) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml (.../DiagnosticsSwipe.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -45,15 +45,21 @@ } width : _root.width - isDiagnostics : true index : view.currentIndex color : Colors.transparent titlePixelSize : 30 + model : _model onItemPressed: function (vIndex) { view.currentIndex = vIndex } + ListModel { id: _model + ListElement { text: qsTr("TD & Blood Handling") ; visible: true } + ListElement { text: qsTr("DD") ; visible: true } + ListElement { text: qsTr("FP") ; visible: true } + } + Line { anchors { bottom : parent.bottom Index: sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml =================================================================== diff -u -rb8a9627cf291b564b0fc1570f9c0a97fa6873035 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml (.../HeaderbarSettings.qml) (revision b8a9627cf291b564b0fc1570f9c0a97fa6873035) +++ sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml (.../HeaderbarSettings.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -23,7 +23,6 @@ SettingsSlider { id: _brightness width : _private.columnWidth value : vDevice.brightnesss ?? 0 - valueText : vDevice.brightnesss ?? Variables.emptyEntry iconImage : "qrc:/images/iBrightness" onValueChanged : vDevice.brightness = slider.value @@ -32,7 +31,6 @@ SettingsSlider { id: _volume width : _private.columnWidth value : vAdjustmentAlarmVolume.hdAlarmVolume ?? 0 - valueText : vAdjustmentAlarmVolume.hdAlarmVolume ?? Variables.emptyEntry iconImage : "qrc:/images/iVolume" onValueChanged : vAdjustmentAlarmVolume.doAdjustment( slider.value ) Index: sources/gui/qml/main.qml =================================================================== diff -u -rbea36be2766046e63c4e82539a630b5cee7ce1c6 -r69c86c57349b7d4a6ba47a801ba27b1c470fade5 --- sources/gui/qml/main.qml (.../main.qml) (revision bea36be2766046e63c4e82539a630b5cee7ce1c6) +++ sources/gui/qml/main.qml (.../main.qml) (revision 69c86c57349b7d4a6ba47a801ba27b1c470fade5) @@ -341,7 +341,7 @@ disable : _GuiView.manufactSetup || _GuiView.updateSetup hidden : true // it should be hidden by default since the landing screen changed to init and it does not have the main menu until the POST passes. width : Variables.applicationWidth - isMainMenu : true + model : _model Component.onCompleted : { _settingsStack.visible = false @@ -355,6 +355,12 @@ _managerStack .visible = vIndex === 1 _settingsStack.visible = vIndex === 2 } + + ListModel { id: _model + ListElement { text: qsTr("Treatment") ; visible: true } + ListElement { text: qsTr("Prescriptions") ; visible: true } + ListElement { text: qsTr("Settings") ; visible: true } + } } Connections { target: vTDOpMode