Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r0dfba44fb7172b9458d161b3ed5f54527f93b698 -rf0e262920199d1d5ebdbe3f1bf0c58c58a82d363 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 0dfba44fb7172b9458d161b3ed5f54527f93b698) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision f0e262920199d1d5ebdbe3f1bf0c58c58a82d363) @@ -11,6 +11,7 @@ property alias loggedUser : _loggedInUser.text readonly property int currentScreen : _headerMenu.currentScreen property alias statusColor : _headerMenu.statusColor + property bool isCreateRx : false // set in slot in parent width : Variables.applicationWidth height : Variables.headerHeight @@ -25,17 +26,28 @@ MouseArea { id: _mouseArea anchors.fill : parent - // TODO: disable this later. this is only for diagnostic purpose. - onDoubleClicked : { - if ( _GuiView.dryDemoMode ) { - let dryDemoTempID = 99 - let id = vConfirm.id - vConfirm.id = dryDemoTempID - vConfirm.doConfirm( true ) - vConfirm.id = id + 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) { + if ( _GuiView.dryDemoMode ) { + let dryDemoTempID = 99 + let id = vConfirm.id + vConfirm.id = dryDemoTempID + vConfirm.doConfirm( true ) + vConfirm.id = id + } + else { + _diagnosticsDialog.open() + } + lastClickTime = 0 } else { - _diagnosticsDialog.open() + lastClickTime = now } } } @@ -50,12 +62,16 @@ } Text { id: _title - color : Colors.textMain - anchors.centerIn : parent - horizontalAlignment : Text.AlignHCenter - verticalAlignment : Text.AlignVCenter - font.pixelSize : Fonts.fontHeaderbarTitle - font.weight : Font.DemiBold + color : Colors.textMain + anchors { + horizontalCenter : parent.horizontalCenter + bottom : _headerMenu.top + } + height : parent.height + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + font.pixelSize : Fonts.fontHeaderbarTitle + font.weight : Font.DemiBold } Item { id: _dateTimeItem @@ -121,8 +137,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 @@ -141,16 +165,6 @@ onPressed : _endTreatmentDialog.open() } - VitalsButton { id : _vitalsButton - extraSpace : _headerButtonRow.spacing - visible : vTDOpMode.preTreatment || - vTDOpMode.inTreatment || - vTDOpMode.postTreatment || - vTDOpMode.validateParameters - - onPressed : _treatmentAdjustmentVitals.open() - } - IconButton { id : _prescriptionButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iPrescription" @@ -162,30 +176,32 @@ onPressed : _headerbarPrescription.open() } - IconButton { id : _wifiButton - iconSize : Variables.headerIconDiameter - iconImageSource : "qrc:/images/iWifi" + VitalsButton { id : _vitalsButton extraSpace : _headerButtonRow.spacing + visible :( vTDOpMode.preTreatment || + vTDOpMode.inTreatment || + vTDOpMode.postTreatment ) && ! _root.isCreateRx - onPressed : _headerbarWifi.openDialog(_wifiButton) + onPressed : _treatmentAdjustmentVitals.open() } - IconButton { id : _cloudSyncButton + IconButton { id : _wifiButton iconSize : Variables.headerIconDiameter - iconImageSource : "qrc:/images/iCloudSync" + iconImageSource : "qrc:/images/iWifi" extraSpace : _headerButtonRow.spacing - enabled : false - onPressed : print("CloudSync button pressed!") + onPressed : _headerbarWifi.openDialog(_wifiButton) } - IconButton { id : _storageButton - iconSize : Variables.headerIconDiameter - iconImageSource : "qrc:/images/iStorage" - extraSpace : _headerButtonRow.spacing + // TODO Phase 2 👋👋👋 +// IconButton { id : _cloudSyncButton +// iconSize : Variables.headerIconDiameter +// iconImageSource : "qrc:/images/iCloudSync" +// extraSpace : _headerButtonRow.spacing +// enabled : false - onPressed : _headerbarStorage.openDialog(_storageButton) - } +// onPressed : print("CloudSync button pressed!") +// } IconButton { id : _settingsButton iconSize : Variables.headerIconDiameter