Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -r65bff6538499d8a7592f5b664982b69d90d102c2 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 65bff6538499d8a7592f5b664982b69d90d102c2) @@ -31,6 +31,7 @@ } property var titles : [] + property var visibleItems : [] property bool hidden : false property int position : MainMenu.Position.Bottom property bool hasRightText : false @@ -54,8 +55,17 @@ } } - onCurrentIndexChanged: itemPressed(currentIndex) + function isItemVisible ( vIndex ) { + return visibleItems [ vIndex ] !== false // used "!== false" to cover undefined as true. + } + function emit_itemPressed ( vIndex ) { + if ( isItemVisible ( vIndex ) ) + itemPressed ( vIndex ) + } + + onCurrentIndexChanged: emit_itemPressed(currentIndex) + /*! * this section olds somkind of the private sections of the object * this section is used as the calculation section whcih soppose not to be changed by user. @@ -109,18 +119,18 @@ animated : false width : partitionWidth height : parent.height - text.text : modelData + text.text : isItemVisible(index) ? modelData : "" // didn't change the visibility to preserve the button location and just didn't display the title and highlihgt bar. border.width: 0 onPressed: { - itemPressed(index) + emit_itemPressed(index) } } } } // the right outer most text with vertical line as a separator Line { - visible: hasRightText + visible: hasRightText && isItemVisible(_rightTouchRect.index) orientation: Line.Orientation.Vertical length: parent.height - rightTextGaps anchors.right: _rightTouchRect.left @@ -132,10 +142,10 @@ visible : hasRightText width : partitionWidth + rightTextGaps height : parent.height - text.text : _private.rightText + text.text : isItemVisible(index) ? _private.rightText : "" // didn't change the visibility to preserve the button location and just didn't display the title and highlihgt bar. border.width: 0 onPressed: { - itemPressed(index) + emit_itemPressed(index) } anchors.right: parent.right anchors.rightMargin: parent.rightPdding Index: sources/gui/qml/main.qml =================================================================== diff -u -r5dce80bb3079b3f0e6e134110e267be3277c3a8d -r65bff6538499d8a7592f5b664982b69d90d102c2 --- sources/gui/qml/main.qml (.../main.qml) (revision 5dce80bb3079b3f0e6e134110e267be3277c3a8d) +++ sources/gui/qml/main.qml (.../main.qml) (revision 65bff6538499d8a7592f5b664982b69d90d102c2) @@ -258,7 +258,8 @@ function isSettings () { _mainMenu.itemPressed(2) } hidden: true // it should be hidden by default since the landing screen changed to init and it does not have the main menu untill the POST passes. - titles: [ qsTr("Treatment") , qsTr("Manager") , qsTr("Settings") ] + titles : [ qsTr("Treatment") , qsTr("Manager") , qsTr("Settings") ] + visibleItems : [ true , false , true ] Component.onCompleted: { _settingsStack.visible = false _managerStack .visible = false Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r5dce80bb3079b3f0e6e134110e267be3277c3a8d -r65bff6538499d8a7592f5b664982b69d90d102c2 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 5dce80bb3079b3f0e6e134110e267be3277c3a8d) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 65bff6538499d8a7592f5b664982b69d90d102c2) @@ -51,16 +51,17 @@ readonly property bool isSBInProgress : ( vHDTreatmentStates.sbRunning || vHDTreatmentStates.sbWaitPump ) - readonly property bool isDialogOpened : _treatmentAdjustmentFlow.visible - || _treatmentAdjustmentPressuresLimits.visible - || _treatmentAdjustmentDuration.visible - || _treatmentUltrafiltrationItem.visible + readonly property bool isDialogOpened : _treatmentAdjustmentFlow .visible + || _treatmentAdjustmentPressuresLimits .visible + || _treatmentAdjustmentDuration .visible + || _treatmentUltrafiltrationItem .visible // Components MainMenu { id: _treatmentMenu y : Variables.mainMenuHeight * -1 position : MainMenu.Position.Top hidden : true titles : [ qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ] + visibleItems : [ true , false , false ] spacing : 20 leftPdding : 20 rightPdding : 50 @@ -77,11 +78,7 @@ } TreatmentBloodPrime { id: _treatmentBloodPrime } - TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem - // - set visible to false as init state to correctly indicate visible screens - // - TreatmentUltrafiltrationItem is not a ScreenItem, thus visible is true automatically - visible:false - } + TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } TreatmentHome { id: _treatmentHome } Connections { target: _treatmentHome Index: sources/gui/qml/pages/treatment/TreatmentUltrafiltrationItem.qml =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -r65bff6538499d8a7592f5b664982b69d90d102c2 --- sources/gui/qml/pages/treatment/TreatmentUltrafiltrationItem.qml (.../TreatmentUltrafiltrationItem.qml) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/gui/qml/pages/treatment/TreatmentUltrafiltrationItem.qml (.../TreatmentUltrafiltrationItem.qml) (revision 65bff6538499d8a7592f5b664982b69d90d102c2) @@ -27,6 +27,11 @@ Item { id: _root objectName: "_TreatmentUltrafiltration" anchors.fill: parent + + // - set visible to false as init state to correctly indicate visible screens + // - TreatmentUltrafiltrationItem is not a ScreenItem, thus visible is true automatically + visible:false + function open() { if ( isUFRunning ) { _treatmentAdjustmentUltrafiltrationStart .open()