Fix volume slider limits if a thing doesn't have volume from 0 to 100
This commit is contained in:
parent
ef40e6e642
commit
e58fb045c1
@ -55,6 +55,7 @@ Item {
|
|||||||
|
|
||||||
readonly property bool hasVolumeControl: thing.thingClass.interfaces.indexOf("volumecontroller") >= 0
|
readonly property bool hasVolumeControl: thing.thingClass.interfaces.indexOf("volumecontroller") >= 0
|
||||||
readonly property State volumeState: thing.stateByName("volume")
|
readonly property State volumeState: thing.stateByName("volume")
|
||||||
|
readonly property StateType volumeStateType: thing.thingClass.stateTypes.findByName("volume")
|
||||||
readonly property State muteState: thing.stateByName("mute")
|
readonly property State muteState: thing.stateByName("mute")
|
||||||
|
|
||||||
readonly property State equalizerPresetState: thing.stateByName("equalizerPreset")
|
readonly property State equalizerPresetState: thing.stateByName("equalizerPreset")
|
||||||
@ -364,8 +365,8 @@ Item {
|
|||||||
Slider {
|
Slider {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
visible: root.volumeState !== null
|
visible: root.volumeState !== null
|
||||||
from: 0
|
from: root.volumeStateType.minValue
|
||||||
to: 100
|
to: root.volumeStateType.maxValue
|
||||||
value: volumeActionQueue.pendingValue || root.volumeState.value
|
value: volumeActionQueue.pendingValue || root.volumeState.value
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
onMoved: volumeActionQueue.sendValue(value)
|
onMoved: volumeActionQueue.sendValue(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user