Index: sources/gui/qml/components/BaseSwitch.qml =================================================================== diff -u -r3d5bd682a4dc4bd36e26ca17067bafd489fa970b -r78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f --- sources/gui/qml/components/BaseSwitch.qml (.../BaseSwitch.qml) (revision 3d5bd682a4dc4bd36e26ca17067bafd489fa970b) +++ sources/gui/qml/components/BaseSwitch.qml (.../BaseSwitch.qml) (revision 78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f) @@ -23,22 +23,33 @@ property bool active : true property real diameter : Variables.sliderCircleDiameter property int margin : 4 + property string source : "" + property string activeColor : Colors.backgroundButtonSelect + property string inactiveColor : Colors.createTreatmentInactive + property string knobColor : _root.active ? Colors.textMain : Colors.borderDisableButton + indicator: Rectangle { implicitWidth : Variables.sliderCircleDiameter * 2.5 implicitHeight : Variables.sliderCircleDiameter + ( _root.margin * 2 ) radius : implicitHeight anchors.centerIn: parent - color : _root.checked && _root.active ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive - border.color : _root.checked && _root.active ? Colors.borderButton : Colors.createTreatmentInactive + color : _root.checked && _root.active ? _root.activeColor : _root.inactiveColor + border.color : _root.checked && _root.active ? _root.activeColor : _root.inactiveColor Rectangle { x: _root.checked ? parent.width - width - _root.margin : _root.margin anchors.verticalCenter: parent.verticalCenter width : _root.diameter height : _root.diameter radius : _root.diameter - color : _root.active ? Colors.textMain : Colors.borderDisableButton + color : _root.knobColor + Image { + source : _root.source + visible: _root.source + anchors.centerIn: parent + } + Behavior on x { NumberAnimation { duration: 150; easing.type: Easing.InOutQuad } } } }