Index: sources/gui/qml/compounds/ValueAdjuster.qml =================================================================== diff -u -rf7b92a45b2b7fa814fba3d080bcf91d465f279df -r9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f --- sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision f7b92a45b2b7fa814fba3d080bcf91d465f279df) +++ sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision 9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f) @@ -27,49 +27,49 @@ property real defaultValue: 0 property real step : 0 property real actualValue : 0 - property bool active : false + property bool isActive : false property bool editable : true - property bool allowOff : false - property bool doRefresh : false + property bool canAllowOff : false + property bool canRefresh : false // fix floating-point precision issue readonly property real stepVal : Math.round(step * 100) / 100 readonly property real minVal : Math.round(minimum * 100) / 100 readonly property real val : Math.round(value * 100) / 100 - readonly property bool canIncrement : active ? value < maximum : true - readonly property bool canDecrement : active ? allowOff ? value > 0 : - value > minimum : true + readonly property bool canIncrement : isActive ? value < maximum : true + readonly property bool canDecrement : isActive ? canAllowOff ? value > 0 : + value > minimum : true - onActiveChanged : { - if ( doRefresh ) { doRefresh = false; return; } + onIsActiveChanged : { + if ( canRefresh ) { canRefresh = false; return; } - if ( active ) { _root.value = _root.defaultValue } + if ( isActive ) { _root.value = _root.defaultValue } } - function refresh () { value = actualValue; doRefresh = true } + function refresh () { value = actualValue; canRefresh = true } - function clear() { _root.active = false } + function clear() { _root.isActive = false } function increment() { - if ( ! active ) { active = true; return; } + if ( ! isActive ) { isActive = true; return; } - if ( allowOff ) { value = val < minVal ? minVal : val + stepVal } - else { value += stepVal } + if ( canAllowOff ) { value = val < minVal ? minVal : val + stepVal } + else { value += stepVal } } function decrement() { - if ( ! active ) { active = true; return; } + if ( ! isActive ) { isActive = true; return; } - if ( allowOff ) { value = val > minVal ? val - stepVal : 0 } - else { value -= stepVal } + if ( canAllowOff ) { value = val > minVal ? val - stepVal : 0 } + else { value -= stepVal } } Text { id: _text anchors.centerIn: parent - text : _root.active ? _root.allowOff ? _root.value === 0 ? - "OFF" : - _root.value.toFixed( _root.decimal ) : + text : _root.isActive ? _root.canAllowOff ? _root.value === 0 ? + "OFF" : + _root.value.toFixed( _root.decimal ) : _root.value.toFixed( _root.decimal ) : Variables.emptyEntry color : Colors.offWhite font.pixelSize : Fonts.fontPixelValueControl @@ -122,7 +122,7 @@ pressAndHoldInterval: 0 onClicked: { - if ( _root.editable ) { active = true; focus = true } + if ( _root.editable ) { isActive = true; focus = true } _slider.opacity = 0 } @@ -134,7 +134,7 @@ } onPressAndHold: { - if ( _root.editable ) { active = true; focus = true } + if ( _root.editable ) { isActive = true; focus = true } _sliderMouseArea.grabbed = true }