popouts/audio: scroll volume slider
Also more spacing
This commit is contained in:
parent
9ada66a78e
commit
7eea88774b
1 changed files with 24 additions and 11 deletions
|
|
@ -55,7 +55,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Appearance.spacing.small
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
Layout.bottomMargin: Appearance.spacing.small / 2
|
Layout.bottomMargin: Appearance.spacing.small / 2
|
||||||
text: qsTr("Input")
|
text: qsTr("Input")
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
|
|
@ -75,24 +75,37 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Appearance.spacing.small
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
Layout.bottomMargin: Appearance.spacing.small / 2
|
Layout.bottomMargin: Appearance.spacing.small / 2
|
||||||
text: qsTr("Volume")
|
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSlider {
|
CustomMouseArea {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: Appearance.padding.normal * 3
|
implicitHeight: Appearance.padding.normal * 3
|
||||||
|
|
||||||
value: Audio.volume
|
onWheel: event => {
|
||||||
onMoved: Audio.setVolume(value)
|
if (event.angleDelta.y > 0)
|
||||||
|
Audio.setVolume(Audio.volume + 0.1);
|
||||||
|
else if (event.angleDelta.y < 0)
|
||||||
|
Audio.setVolume(Audio.volume - 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on value {
|
StyledSlider {
|
||||||
NumberAnimation {
|
anchors.left: parent.left
|
||||||
duration: Appearance.anim.durations.normal
|
anchors.right: parent.right
|
||||||
easing.type: Easing.BezierSpline
|
implicitHeight: parent.implicitHeight
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
|
value: Audio.volume
|
||||||
|
onMoved: Audio.setVolume(value)
|
||||||
|
|
||||||
|
Behavior on value {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Appearance.anim.durations.normal
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standard
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue