Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -rc8eb6d0e29f8951a793b2f52d11a08b9902470ee -r305d411b4bc617d858075f5750dea487d707bebb --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision c8eb6d0e29f8951a793b2f52d11a08b9902470ee) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 305d411b4bc617d858075f5750dea487d707bebb) @@ -30,6 +30,7 @@ // Qt import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 // Project // Qml imports @@ -67,95 +68,162 @@ anchors.bottom: parent.bottom width: parent.width contentWidth: parent.width - contentHeight: parent.height + contentHeight: _column.implicitHeight clip: true - Rectangle { - color: "transparent"; + Column { + id: _column + spacing: Variables.cTreatmentSpacing + anchors.horizontalCenter: parent.horizontalCenter; anchors.fill: parent; - Column { - spacing: Variables.cTreatmentSpacing + + Text { id: _titleText anchors.horizontalCenter: parent.horizontalCenter; - anchors.fill: parent; + text: qsTr("Create a Custom Treatment") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } - Text { id: _titleText - anchors.horizontalCenter: parent.horizontalCenter; - text: qsTr("Create a Custom Treatment") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } + Text { + anchors.horizontalCenter: parent.horizontalCenter; + text: qsTr("PRESCRIPTION"); + color: Colors.textMain; + font.pixelSize: Fonts.fontPixelButton + font.bold: true + } + + SliderCreateTreatment { + id: _bloodFlowRate + text: "Blood Flow Rate" + units: qsTr(" mL/min") + min: 100 + max: 500 + } + + SliderCreateTreatment { + id: _dialysateFlowRate + text: "Dialysate Flow Rate" + units: qsTr(" mL/min") + min: 100 + max: 600 + } + + SliderCreateTreatment { + id: _duration + text: "Duration" + units: qsTr(" min") + min: 60 + max: 480 + } + + SliderCreateTreatment { + id: _heparinDispensingRate + text: "Heparin Dispensing Rate" + units: qsTr(" IU/hr") + min: 0 + max: 1000 + } + + SliderCreateTreatment { + id: _heparinBolusVolume + text: "Heparin Bolus Volume" + units: qsTr(" IU") + min: 100 + max: 2000 + } + + // TODO: if possible, make this a component + Rectangle { + id: _rectInfusionSolBolus + anchors.horizontalCenter: parent.horizontalCenter + color: "transparent" + property int numRows: 1 + property int numCols: 3 + property int buttonHeight: 96 + property int buttonWidth: 214 + height: numRows * buttonHeight + width: numCols * buttonWidth + Text { - anchors.horizontalCenter: parent.horizontalCenter; - text: qsTr("PRESCRIPTION"); + id: _infusionSolutionBolus + text: "Infusion Solution Bolus" + font.pixelSize: Fonts.fontPixelFluidText color: Colors.textMain; - font.pixelSize: Fonts.fontPixelButton - font.bold: true - } - SliderCreateTreatment { - id: _bloodFlowRate - text: "Blood Flow Rate" - units: qsTr(" mL/min") - min: 100 - max: 500 - } + GridLayout { + id: _grid + anchors.top: _infusionSolutionBolus.bottom + anchors.topMargin: Variables.sliderTextMargin + rows: parent.numRows + columns: parent.numCols - SliderCreateTreatment { - id: _dialysateFlowRate - text: "Dialysate Flow Rate" - units: qsTr(" mL/min") - min: 100 - max: 600 - } + TouchRect { + id: _100mL + text.text: "100 mL"; + selectable: true + height: _rectInfusionSolBolus.buttonHeight + width: _rectInfusionSolBolus.buttonWidth + radius: 0 + onClicked: { + _200mL.setSelected(false) + _300mL.setSelected(false) + } + } - SliderCreateTreatment { - id: _duration - text: "Duration" - units: qsTr(" min") - min: 60 - max: 480 - } + TouchRect { + id: _200mL + text.text: "200 mL"; + selectable: true + height: _rectInfusionSolBolus.buttonHeight + width: _rectInfusionSolBolus.buttonWidth + radius: 0 + onClicked: { + _300mL.setSelected(false) + _100mL.setSelected(false) + } + } - SliderCreateTreatment { - id: _heparinDispensingRate - text: "Heparin Dispensing Rate" - units: qsTr(" IU/hr") - min: 0 - max: 1000 + TouchRect { + id: _300mL + text.text: "300 mL"; + selectable: true + height: _rectInfusionSolBolus.buttonHeight + width: _rectInfusionSolBolus.buttonWidth + radius: 0 + animated: true + duration: 50 + onClicked: { + _100mL.setSelected(false) + _200mL.setSelected(false) + } + } } - SliderCreateTreatment { - id: _heparinBolusVolume - text: "Heparin Bolus Volume" - units: qsTr(" IU") - min: 100 - max: 2000 - } + } - TouchRect { id : _continueRect - anchors.horizontalCenter: parent.horizontalCenter - text.text: qsTr("CONTINUE") - button.onClicked: _root.clickedContinue() - } + TouchRect { id : _continueRect + anchors.horizontalCenter: parent.horizontalCenter + text.text: qsTr("CONTINUE") + button.onClicked: _root.clickedContinue() } } + } - states: State { - when: _flickable.movingVertically - PropertyChanges { - target: _verticalScrollBar - opacity: 0.8 - } + states: State { + when: _flickable.movingVertically + PropertyChanges { + target: _verticalScrollBar + opacity: 0.8 } } ScrollBar { anchors.top: _flickable.top anchors.bottom: _flickable.bottom id: _verticalScrollBar - size: Variables.scrollBarSize + size: _flickable.height / _column.implicitHeight active: true anchors.right: _flickable.right anchors.rightMargin: 5