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;
|
pressStartX = e.x;
|
||||||
pressStartPos = root.visualPosition;
|
pressStartPos = root.visualPosition;
|
||||||
}
|
}
|
||||||
onPositionChanged: e => dragMovement = (e.x - pressStartX) / width
|
onPositionChanged: e => {
|
||||||
|
dragMovement = (e.x - pressStartX) / width;
|
||||||
|
root.interaction(posBinding.value);
|
||||||
|
}
|
||||||
onReleased: e => {
|
onReleased: e => {
|
||||||
root.interaction(posBinding.value);
|
root.interaction(posBinding.value);
|
||||||
widthBehavior.enabled = true;
|
widthBehavior.enabled = true;
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ Item {
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Tokens.spacing.medium
|
Layout.topMargin: Tokens.spacing.medium
|
||||||
Layout.bottomMargin: -Tokens.spacing.extraSmall
|
|
||||||
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
||||||
font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
|
font: Tokens.font.body.builders.medium.weight(Font.Medium).build()
|
||||||
}
|
}
|
||||||
|
|
@ -95,11 +94,7 @@ Item {
|
||||||
implicitHeight: parent.implicitHeight
|
implicitHeight: parent.implicitHeight
|
||||||
|
|
||||||
value: Audio.volume
|
value: Audio.volume
|
||||||
onMoved: Audio.setVolume(value)
|
onInteraction: value => Audio.setVolume(value)
|
||||||
|
|
||||||
Behavior on value {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue