Index: denali.pro.user =================================================================== diff -u -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 -r12cfad32f345ac72d777f9b97d25bdd4d0848527 --- denali.pro.user (.../denali.pro.user) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) +++ denali.pro.user (.../denali.pro.user) (revision 12cfad32f345ac72d777f9b97d25bdd4d0848527) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -89,7 +89,7 @@ Desktop Qt 5.12.5 GCC 64bit Desktop Qt 5.12.5 GCC 64bit qt.qt5.5125.gcc_64_kit - 1 + 0 0 0 Index: denali.qrc =================================================================== diff -u -r846a9ebc350e33be4affab3cc4c136248900015d -r12cfad32f345ac72d777f9b97d25bdd4d0848527 --- denali.qrc (.../denali.qrc) (revision 846a9ebc350e33be4affab3cc4c136248900015d) +++ denali.qrc (.../denali.qrc) (revision 12cfad32f345ac72d777f9b97d25bdd4d0848527) @@ -64,7 +64,7 @@ sources/gui/qml/components/ConfirmTreatmentTable.qml sources/gui/qml/components/ConfirmTreatmentSubTable.qml sources/gui/qml/components/SliderDoubleCreateTreatment.qml - sources/gui/qml/components/RectSelectCreateTreatment.qml + sources/gui/qml/components/GridSelection.qml sources/gui/qml/components/TopMenuBarCreateTreatment.qml sources/gui/qml/components/ProgressBarEx.qml sources/gui/qml/components/CloseButton.qml Index: sources/gui/qml/components/GridSelection.qml =================================================================== diff -u --- sources/gui/qml/components/GridSelection.qml (revision 0) +++ sources/gui/qml/components/GridSelection.qml (revision 12cfad32f345ac72d777f9b97d25bdd4d0848527) @@ -0,0 +1,103 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright \n + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n + * IN PART OR IN WHOLE, \n + * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * + * \file SliderCreateTreatment.qml + * \date 2020/07/07 + * \author Peter Lucia + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Layouts 1.12 + +// Project + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +Rectangle { + id: _root + anchors.horizontalCenter: parent.horizontalCenter + color: "transparent" + property int numRows : 2 + property int numCols : 2 + property int buttonHeight : 78 + property int buttonWidth : 313 + property var buttonNames : ["Button 1", "Button 2", "Button 3"] + property alias name : _text.text + property int selectedIndex : unselectedIndex + property int unselectedIndex : 9999 + height: numRows * buttonHeight + width: numCols * buttonWidth + signal buttonClicked() + + + function setValid(valid) { + if (valid) { + _text.color = Colors.textMain + } else { + _text.color = Colors.textInvalid + } + } + + function setActive(active) { + if (!active) { + for (let i = 0; i < _repeater.count; i++) { + _repeater.itemAt(i).setSelected(false) + } + selectedIndex = unselectedIndex + } + } + + Text { + id: _text + text: "Title" + font.pixelSize: Fonts.fontPixelFluidText + color: Colors.textMain; + } + + GridLayout { + id: _grid + anchors.top: _text.bottom + anchors.topMargin: Variables.sliderTextMargin + rows: parent.numRows + columns: parent.numCols + + Repeater { id: _repeater + model: buttonNames + TouchRect { + id: _touchRect + objectName: _root.objectName + index + text.text: modelData; + selectable: true + height: _root.buttonHeight + width: _root.buttonWidth + radius: 0 + onClicked: { + _text.color = Colors.textMain + if (selectedIndex === index) { + _repeater.itemAt(index).setSelected(false) + selectedIndex = unselectedIndex + } else { + _repeater.itemAt(index).setSelected(true) + selectedIndex = index + } + + for (let j = 0; j < _repeater.count; j += 1) { + if (index !== j) { + _repeater.itemAt(j).setSelected(false) + } + } + buttonClicked() + } + } + } + } +} Fisheye: Tag 12cfad32f345ac72d777f9b97d25bdd4d0848527 refers to a dead (removed) revision in file `sources/gui/qml/components/RectSelectCreateTreatment.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r074b32b5cc08f41f2d9ce0d021f2151b76bba5ad -r12cfad32f345ac72d777f9b97d25bdd4d0848527 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 074b32b5cc08f41f2d9ce0d021f2151b76bba5ad) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 12cfad32f345ac72d777f9b97d25bdd4d0848527) @@ -50,6 +50,7 @@ readonly property color textButton : "#FCFCFC" //"#E8E8E8" readonly property color textDisableButton : "#607A91" readonly property color textTickMark : "#438FEB" + readonly property color textInvalid : "red" readonly property color borderButton : "#4290EC" //K:D //"#438FEB" readonly property color borderDisableButton : "#607A91" Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 -r12cfad32f345ac72d777f9b97d25bdd4d0848527 --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 12cfad32f345ac72d777f9b97d25bdd4d0848527) @@ -179,7 +179,7 @@ } } - RectSelectCreateTreatment { + GridSelection { id: _acidConcentrate objectName: "_acidConcentrateRect" name: "Acid Concentrate" @@ -189,7 +189,7 @@ } } - RectSelectCreateTreatment { + GridSelection { id: _bicarbonateConcentrate objectName: "_bicarbonateConcentrateRect" name: "Bicarbonate Concentrate" @@ -201,7 +201,7 @@ } } - RectSelectCreateTreatment { + GridSelection { id: _dialyzerType objectName: "_dialyzerTypeRect" name: "Dialyzer Type"