Use vertical volume slider on mobile

This is possible by removing the hack that was causing trouble with the
vertical orientation.
This commit is contained in:
Bart De Vries 2023-02-02 16:09:04 +01:00
parent bc4dc313b7
commit 8ad0365a4a
2 changed files with 9 additions and 10 deletions

View File

@ -292,7 +292,6 @@ FocusScope {
to: 100 to: 100
value: AudioManager.volume value: AudioManager.volume
onMoved: AudioManager.volume = value onMoved: AudioManager.volume = value
handle.implicitWidth: implicitHeight // workaround to make slider handle position itself exactly at the location of the click
} }
Controls.ToolButton { Controls.ToolButton {

View File

@ -354,14 +354,14 @@ Kirigami.Page {
Controls.Popup { Controls.Popup {
id: volumePopup id: volumePopup
x: -volumePopup.width + volumeButton.width x: -padding
y: -volumePopup.height y: -volumePopup.height
focus: true focus: true
padding: Kirigami.Units.smallSpacing padding: Kirigami.Units.smallSpacing
contentHeight: muteButton.implicitHeight contentWidth: muteButton.implicitWidth
contentItem: RowLayout { contentItem: ColumnLayout {
id: popupContent id: popupContent
Controls.ToolButton { Controls.ToolButton {
@ -378,18 +378,18 @@ Kirigami.Page {
Controls.Slider { Controls.Slider {
id: volumeSlider id: volumeSlider
width: Kirigami.Units.gridUnit * 7 height: Kirigami.Units.gridUnit * 7
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: width Layout.preferredHeight: height
Layout.maximumWidth: width Layout.maximumHeight: height
Layout.rightMargin: Kirigami.Units.smallSpacing Layout.bottomMargin: Kirigami.Units.smallSpacing
orientation: Qt.Vertical
padding: 0 padding: 0
enabled: !AudioManager.muted && AudioManager.PlaybackState != AudioManager.StoppedState && AudioManager.canPlay enabled: !AudioManager.muted && AudioManager.PlaybackState != AudioManager.StoppedState && AudioManager.canPlay
from: 0 from: 0
to: 100 to: 100
value: AudioManager.volume value: AudioManager.volume
onMoved: AudioManager.volume = value onMoved: AudioManager.volume = value
handle.implicitWidth: implicitHeight // workaround to make slider handle position itself exactly at the location of the click
} }
} }