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,16 +75,28 @@ 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
|
||||||
|
|
||||||
|
onWheel: event => {
|
||||||
|
if (event.angleDelta.y > 0)
|
||||||
|
Audio.setVolume(Audio.volume + 0.1);
|
||||||
|
else if (event.angleDelta.y < 0)
|
||||||
|
Audio.setVolume(Audio.volume - 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledSlider {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
implicitHeight: parent.implicitHeight
|
||||||
|
|
||||||
value: Audio.volume
|
value: Audio.volume
|
||||||
onMoved: Audio.setVolume(value)
|
onMoved: Audio.setVolume(value)
|
||||||
|
|
||||||
|
|
@ -96,6 +108,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.topMargin: Appearance.spacing.normal
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue