Index: sources/gui/qml/pages/TreatmentFlowBase.qml =================================================================== diff -u -r3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5 -r4a2b83dcb56555861d2c741a8e8894e5b07e24bf --- sources/gui/qml/pages/TreatmentFlowBase.qml (.../TreatmentFlowBase.qml) (revision 3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5) +++ sources/gui/qml/pages/TreatmentFlowBase.qml (.../TreatmentFlowBase.qml) (revision 4a2b83dcb56555861d2c741a8e8894e5b07e24bf) @@ -36,10 +36,10 @@ property bool instructionBased : false readonly property alias instruction : _instructionLoader.item - property string instructionlocation : "" + property string instructionTitle : "" property var instructionStepNames : [] property var instructionStepImages : [] - readonly property bool instructionIsLast: instruction ? instruction.lastStep : true + property string subStepName : "" // used for instructions with miltiple sub steps property bool hasTimeCircle : false readonly property alias timeCircle : _timeCircleLoader.item @@ -56,12 +56,12 @@ property bool checkListTimeVisible : false property int checkListTimeSeconds : 0 - property string completeText : "" property bool isComplete : false - readonly property int titleTopMargin: 110 + property int titleTopMargin: 110 + readonly property int sideMargins : Variables.defaultMargin * 2 + Variables.headerButtonsMargin // matching header button margins signal backClicked() signal confirmClicked() @@ -70,7 +70,7 @@ if (checkList) checkList.resetItems() if (instruction) - instruction.currentStepIndex = 0 + instruction.currentIndex = 0 _notification.text = "" if (visible) { _mainMenu.hidden = true @@ -80,10 +80,15 @@ // vvvvvvvvvvvvvvvvvvvvvvvvv HEADER vvvvvvvvvvvvvvvvvvvvvvvvv // StepNavigationTitleBar { id: _titleBar stepIndex : stackStepIndex // shall have a definition in the parent stack - anchors.top : _root.top - anchors.horizontalCenter : parent.horizontalCenter + anchors { + top : _root.top + left : parent.left + right : parent.right + leftMargin : Variables.defaultMargin * 2 + rightMargin : anchors.leftMargin + } + width : _root.width - confirmEnabled : instruction ? instruction.lastStep : true stepNames : [ ] onBackClicked : _root.backClicked() onConfirmClicked: _root.confirmClicked() @@ -96,39 +101,34 @@ topMargin : titleTopMargin horizontalCenter: parent.horizontalCenter } - text : qsTr("TreatmentFlowBase") color : Colors.textMain font.pixelSize : Fonts.fontPixelTitle } - // ^^^^^^^^^^^^^^^^^^^^^^^^^ HEADER ^^^^^^^^^^^^^^^^^^^^^^^^^ // // vvvvvvvvvvvvvvvvvvvv Optional Components vvvvvvvvvvvvvvvvvvvv // Loader { id: _instructionLoader - readonly property int outerHMargin : 30 readonly property int outerVMargin : 15 active : _root.instructionBased anchors { top : title.visible ? title.bottom : title.top bottom : footer.top left : parent.left right : parent.right - leftMargin : outerHMargin - rightMargin : outerHMargin + leftMargin : _root.sideMargins + rightMargin : _root.sideMargins topMargin : outerVMargin bottomMargin : outerVMargin } sourceComponent : InstructionView { id: _instructionView - label : title.visible ? "" : _root.title.text - location : _root.instructionlocation + title : _root.instructionTitle stepNames : _root.instructionStepNames stepImages : _root.instructionStepImages } } Loader { id : _timeCircleLoader active : _root.hasTimeCircle - anchors.top : _root.hasCheckList ? title.bottom : undefined anchors.topMargin : _root.hasCheckList ? 25 : 0 anchors.horizontalCenter: _root.horizontalCenter @@ -139,16 +139,16 @@ maximum : _root.timeCircleMaximum progressValue : _root.timeCircleProgressValue timeTextValue : _root.timeCircleTimeTextValue - thickness : _root.hasCheckList ? 1 : 2 + thickness : 15 diameter : _root.hasCheckList ? Variables.progressCircleDiameterSmall : Variables.progressCircleDiameterNormal timeTextPixelSize : _root.hasCheckList ? Fonts.fontPixelCirclProgressTimeSmall : Fonts.fontPixelCirclProgressTimeNormal } } Loader { id: _checkListLoader active : _root.hasCheckList - anchors.top : _root.hasTimeCircle ? _timeCircleLoader.bottom : undefined - anchors.topMargin : _root.hasTimeCircle ? 25 : 0 + anchors.top : _root.hasTimeCircle ? _timeCircleLoader.bottom : undefined + anchors.topMargin : _root.hasTimeCircle ? Variables.defaultMargin * 2 : 0 anchors.horizontalCenter: _root.horizontalCenter anchors.centerIn : ! _root.hasTimeCircle ? parent : undefined width : Variables.checkListViewItemWidth @@ -176,23 +176,4 @@ } NotificationBarSmall { id: _notification } - - Connections { target: vSettings - function onInstructionsChanged ( vValue ) { - if ( instructionBased ) { - let stepName = header.stepNames[stackStepIndex] - if ( stepName === undefined ) stepName = "" - let group = vSettings.groupFormat.arg(stepName).arg(title.text) - let instructionsGroup = vSettings.instructions[group] - if ( instructionsGroup !== undefined ) { - // DEBUG : - // console.debug(" 00000 ", group, settingsGroup, settingsCategory.groups) - _root.instructionlocation = instructionsGroup.location - _root.instructionStepNames = instructionsGroup.keys - _root.instructionStepImages = instructionsGroup.values - } - } - } - } - }