Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -rc71deaab48699cffdf9db816dfac2778d79c2238 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) @@ -36,7 +36,37 @@ property alias handler : _handler + property alias diameter : _handler.diameter + property alias knobColor : _handler.color + property bool isActive : false; + signal progressRectClicked() + signal progressRectDragged() + signal activeChanged() + + function setActive(active) { + if (active) { + color = Colors.createTreatmentActive + knobColor = Colors.createTreatmentActive + } else { + color = Colors.createTreatmentInactive + knobColor = Colors.createTreatmentInactive + } + + if (active !== isActive) { + isActive = active; + activeChanged() + } + } + + onIsActiveChanged: { + setActive(isActive) + if (!isActive) { + value = minimum + } + activeChanged() + } + height : Variables.progressbarHeight touchMargin : 25 @@ -76,7 +106,7 @@ value = getValueOfX(x) - if ( step === 1 ) { /* keep the value and return */ return; } + if ( step === 1 ) { value = parseInt(value); return; } var start = 0 if ( ! stepSnap ) start = minimum @@ -97,9 +127,11 @@ // propagation is not working on drag ! onDragged: { setValue(vMouseEvent.x) + progressRectDragged() } onClicked: { setValue(vMouseEvent.x) + progressRectClicked() } }