Index: sources/gui/qml/components/StepIndicator.qml =================================================================== diff -u -r4a2b83dcb56555861d2c741a8e8894e5b07e24bf -r8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7 --- sources/gui/qml/components/StepIndicator.qml (.../StepIndicator.qml) (revision 4a2b83dcb56555861d2c741a8e8894e5b07e24bf) +++ sources/gui/qml/components/StepIndicator.qml (.../StepIndicator.qml) (revision 8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7) @@ -30,90 +30,47 @@ Rectangle { id: _root property bool currentComplete : false property bool hideLabels : false - property bool vertical : false property var stepNames : [] - property int spacing : vertical ? 0 : 5 - property int spacerLineLength : vertical ? 5 : 75 + property var subSteps : [] // default all sub steps to 0 + property int spacing : 5 + property int spacerLineLength : 75 property int currentStepIndex : 0 property int diameter : 15 - property int subStepIndex : 0 - property int subStepsLength : 0 - width : _gridSteps.width - height : _gridSteps.height + width : _row.width + height : _row.height color : Colors.transparent - QtObject { id: _private - property string stepNamesFirst: "" - property var stepNamesRest : [] - function setupModel(names) { - stepNamesRest = [] // reset list first - if ( names.length > 1 ) { - for (let i = 0; i < names.length; i++) { - if (i === 0) { - stepNamesFirst = names[i] - } - else { - stepNamesRest[i-1] = names[i] - } - } - } - else { - if (names.length) stepNamesFirst = names[0] - else stepNamesFirst = "" - } - ///////////////////////////////////////////////// - // it is so odd that when the stepNamesRest set by settings the change event is not called - // so it has been called manually. I couldn't find why, and needs more investigation. - // The good point is the binding of the model (_tailStepsRepeater.model) is called once. - ///////////////////////////////////////////////// - if (stepNamesRest.length) stepNamesRestChanged() - } - } + Row { id: _row + spacing : _root.spacing + anchors.centerIn: parent - onStepNamesChanged: { - _private.setupModel(_root.stepNames) - } + Repeater { id: repeater + model: _root.stepNames - Grid { id: _gridSteps - rows : _root.vertical ? 0 : 1 - columns : _root.vertical ? 1 : 0 - rowSpacing : _root.spacing - columnSpacing : _root.spacing - anchors.centerIn: parent - StepBullet { id: _headStepBullet - diameter : _root.diameter - currentComplete : _root.currentComplete - hideLabels : _root.hideLabels - vertical : _root.vertical - text : _private.stepNamesFirst - complete : currentStepIndex > 0 - current : currentStepIndex == 0 - } - Repeater { id: _tailStepsRepeater - model: _private.stepNamesRest - // DEBUG : onModelChanged: console.debug(" 88888 ", _root.stepNames) - Grid { id: _gridStepsRest - rows : _root.vertical ? 0 : 1 - columns : _root.vertical ? 1 : 0 + Grid { id: _gridSteps + rows : 1 + columns : 0 rowSpacing : _root.spacing columnSpacing : _root.spacing verticalItemAlignment : Grid.AlignVCenter horizontalItemAlignment : Grid.AlignHCenter + Line { id : _spacerLine orientation: _root.vertical ? Line.Orientation.Vertical : Line.Orientation.Horizontal length : _root.spacerLineLength - color : _nextStepsBullet.color + color : _stepsBullet.color + visible : index !== 0 // do not show fist line onl lines inbetween bullets } - StepBullet { id: _nextStepsBullet + + StepBullet { id: _stepsBullet diameter : _root.diameter currentComplete : _root.currentComplete hideLabels : _root.hideLabels - vertical : _root.vertical text : modelData - complete : currentStepIndex > 0 && index < currentStepIndex - 1 // first index is used for the head/first bullet - current : currentStepIndex > 0 && index === currentStepIndex - 1 // first index is used for the head/first bullet + complete : index < currentStepIndex + current : index === currentStepIndex SubStepIndicator { id: _subStep anchors { @@ -123,10 +80,10 @@ } subStepIndex : _root.subStepIndex - subStepsLength : _root.subStepsLength + subStepsLength : _root.subSteps[index] ?? 0 height : 10 - width : _nextStepsBullet.width * _root.subStepsLength - visible : _nextStepsBullet.current && _root.subStepsLength > 0 + width : _stepsBullet.width * _root.subSteps[index] + complete : _stepsBullet.complete } } } Index: sources/gui/qml/components/SubStepIndicator.qml =================================================================== diff -u -ra55e0de27d8c427dd4d441f47bb22ca2fe0ca462 -r8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7 --- sources/gui/qml/components/SubStepIndicator.qml (.../SubStepIndicator.qml) (revision a55e0de27d8c427dd4d441f47bb22ca2fe0ca462) +++ sources/gui/qml/components/SubStepIndicator.qml (.../SubStepIndicator.qml) (revision 8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7) @@ -13,15 +13,16 @@ property int subStepIndex : 0 property int subStepsLength : 0 property int spacing : 5 + property bool complete : false Row { id: _row spacing: 5 anchors.centerIn: parent - Repeater { id: _tailStepsRepeater + Repeater { id: _repeater model: _root.subStepsLength - Grid { id: _gridStepsRest + Grid { id: _gridSteps rows : 1 columns : 0 rowSpacing : _root.spacing @@ -30,11 +31,11 @@ horizontalItemAlignment : Grid.AlignHCenter Line { id : _spacerLine - color : _nextStepsBullet.color + color : _stepsBullet.color visible : index !== 0 // do not show fist line onl lines inbetween bullets } - StepBullet { id: _nextStepsBullet - complete : _root.subStepIndex > 0 && index < _root.subStepIndex - 1 // first index is used for the head/first bullet + StepBullet { id: _stepsBullet + complete : _root.complete || _root.subStepIndex > 0 && index < _root.subStepIndex - 1 // first index is used for the head/first bullet current : _root.subStepIndex > 0 && index === _root.subStepIndex - 1 // first index is used for the head/first bullet showCompleteCheck : false diameter : 13 Index: sources/gui/qml/compounds/StepNavigationTitleBar.qml =================================================================== diff -u -r4a2b83dcb56555861d2c741a8e8894e5b07e24bf -r8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7 --- sources/gui/qml/compounds/StepNavigationTitleBar.qml (.../StepNavigationTitleBar.qml) (revision 4a2b83dcb56555861d2c741a8e8894e5b07e24bf) +++ sources/gui/qml/compounds/StepNavigationTitleBar.qml (.../StepNavigationTitleBar.qml) (revision 8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7) @@ -27,10 +27,10 @@ Rectangle { id: _root property int stepIndex : 0 property int subStepIndex : 0 - property int subStepsLength : 0 property int stepLineLength : 125 property var stepNames : [] + property var subSteps : [] property alias backVisible : _backButton .visible property alias backEnabled : _backButton .enabled property alias confirmVisible : _confirmButton.visible @@ -69,7 +69,7 @@ spacerLineLength: _root.stepLineLength stepNames : _root.stepNames subStepIndex : _root.subStepIndex - subStepsLength : _root.subStepsLength + subSteps : _root.subSteps } } } Index: sources/gui/qml/pages/pretreatment/PreTreatmentInstallStack.qml =================================================================== diff -u -r4a2b83dcb56555861d2c741a8e8894e5b07e24bf -r8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7 --- sources/gui/qml/pages/pretreatment/PreTreatmentInstallStack.qml (.../PreTreatmentInstallStack.qml) (revision 4a2b83dcb56555861d2c741a8e8894e5b07e24bf) +++ sources/gui/qml/pages/pretreatment/PreTreatmentInstallStack.qml (.../PreTreatmentInstallStack.qml) (revision 8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7) @@ -18,7 +18,7 @@ BloodSetTubing , BloodLines , PressureLinesAndDialyzer, - SubStepCount + Count } property int subStepIndex: PreTreatmentInstallStack.Step.BloodSetTubing Index: sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml =================================================================== diff -u -ra55e0de27d8c427dd4d441f47bb22ca2fe0ca462 -r8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7 --- sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml (.../PreTreatmentStack.qml) (revision a55e0de27d8c427dd4d441f47bb22ca2fe0ca462) +++ sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml (.../PreTreatmentStack.qml) (revision 8a9a7d5cb3e54aa73e499ddec62653893e7d5ca7) @@ -135,20 +135,18 @@ break case PreTreatmentStack.Step.WaterSample: vPreTreatmentAdjustmentWaterSample.doResult( _pretreatmentWaterSample.result ) - page ( _pretreatmentCreate ) // TODO remove when i do messaging + page ( _pretreatmentCreate ) // TODO remove when implementing messaging break case PreTreatmentStack.Step.CreateRx: _pretreatmentCreate.confirmButtonClicked() if ( vTreatmentCreate.parametersValidated ) { page ( _pretreatmentDialysateUf ) } break case PreTreatmentStack.Step.DialysateUF: vPreTreatmentAdjustmentUltrafiltrationInit.doAdjustment(_pretreatmentDialysateUf.ufVolume) - page ( _pretreatmentConnect ) // TODO remove when i do messaging + page ( _pretreatmentConnect ) // TODO remove when implementing messaging break case PreTreatmentStack.Step.Connect: vPreTreatmentAdjustmentStartTreatment.doStart() - // TODO Keep for now until we figure out if this isnt going to be used anymore -// vPreTreatmentAdjustmentPatientConnectionConfirm.doConfirm() break default: break @@ -199,7 +197,7 @@ function confirmEnabled() { switch ( stepKeys[_root.stackStepIndex] ) { -// case PreTreatmentStack.Step.SelfTests: +// case PreTreatmentStack.Step.SelfTests: // TODO set when implementing self test/ prime // return _pretreatmentSelfTests.isComplete // case PreTreatmentStack.Step.Prime: // return _pretreatmentPrime.isComplete @@ -230,7 +228,11 @@ width : _root.width stepNames : _root.stepNames subStepIndex : isInstall ? _pretreatmentInstallation.subStepIndex + 1 : 0 - subStepsLength : isInstall ? PreTreatmentInstallStack.Step.SubStepCount : 0 + subSteps : { + let arr =Array(stepNames.length).fill(0) + if ( ! vSettings.advancedMode ) { arr[stepKeys.indexOf(PreTreatmentStack.Step.Installation)] = PreTreatmentInstallStack.Step.Count } + return arr + } onBackClicked : _root.backClicked() onConfirmClicked: _root.confirmClicked()