fix: audio popout slider + trigger on movement
Emit interaction signal on every movement instead of just release
This commit is contained in:
parent
5f2e772250
commit
6931b41d96
2 changed files with 5 additions and 7 deletions
|
|
@ -168,7 +168,10 @@ Slider {
|
|||
pressStartX = e.x;
|
||||
pressStartPos = root.visualPosition;
|
||||
}
|
||||
onPositionChanged: e => dragMovement = (e.x - pressStartX) / width
|
||||
onPositionChanged: e => {
|
||||
dragMovement = (e.x - pressStartX) / width;
|
||||
root.interaction(posBinding.value);
|
||||
}
|
||||
onReleased: e => {
|
||||
root.interaction(posBinding.value);
|
||||
widthBehavior.enabled = true;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ Item {
|
|||
|
||||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.medium
|
||||
Layout.bottomMargin: -Tokens.spacing.extraSmall
|
||||
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
||||
font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
|
||||
}
|
||||
|
|
@ -95,11 +94,7 @@ Item {
|
|||
implicitHeight: parent.implicitHeight
|
||||
|
||||
value: Audio.volume
|
||||
onMoved: Audio.setVolume(value)
|
||||
|
||||
Behavior on value {
|
||||
Anim {}
|
||||
}
|
||||
onInteraction: value => Audio.setVolume(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue