summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-05 16:15:51 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-05 16:15:51 +1000
commit2628ee1c41b201ae9a355b8d01f5f04a38d61cc5 (patch)
treebdbcb0fe88826dc1fc53a250fae7db6c2c1cb96a /components
parentpopouts/audio: scroll volume slider (diff)
downloadcaelestia-shell-2628ee1c41b201ae9a355b8d01f5f04a38d61cc5.tar.gz
caelestia-shell-2628ee1c41b201ae9a355b8d01f5f04a38d61cc5.tar.bz2
caelestia-shell-2628ee1c41b201ae9a355b8d01f5f04a38d61cc5.zip
internal: position slider handle correctly
Also better labels for audio popout
Diffstat (limited to 'components')
-rw-r--r--components/controls/StyledSlider.qml36
1 files changed, 17 insertions, 19 deletions
diff --git a/components/controls/StyledSlider.qml b/components/controls/StyledSlider.qml
index 0352cef..25b5bdd 100644
--- a/components/controls/StyledSlider.qml
+++ b/components/controls/StyledSlider.qml
@@ -1,59 +1,57 @@
import qs.components
-import qs.config
import qs.services
-import QtQuick.Controls
+import qs.config
import QtQuick
+import QtQuick.Controls
Slider {
- id: slider
+ id: root
background: Item {
StyledRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
- anchors.topMargin: slider.implicitHeight / 3
- anchors.bottomMargin: slider.implicitHeight / 3
+ anchors.topMargin: root.implicitHeight / 3
+ anchors.bottomMargin: root.implicitHeight / 3
- implicitWidth: slider.handle.x - slider.implicitHeight / 6
+ implicitWidth: root.handle.x - root.implicitHeight / 6
color: Colours.palette.m3primary
radius: Appearance.rounding.full
- topRightRadius: slider.implicitHeight / 15
- bottomRightRadius: slider.implicitHeight / 15
+ topRightRadius: root.implicitHeight / 15
+ bottomRightRadius: root.implicitHeight / 15
}
StyledRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
- anchors.topMargin: slider.implicitHeight / 3
- anchors.bottomMargin: slider.implicitHeight / 3
+ anchors.topMargin: root.implicitHeight / 3
+ anchors.bottomMargin: root.implicitHeight / 3
- implicitWidth: parent.width - slider.handle.x - slider.handle.implicitWidth - slider.implicitHeight / 6
+ implicitWidth: parent.width - root.handle.x - root.handle.implicitWidth - root.implicitHeight / 6
color: Colours.palette.m3surfaceContainer
radius: Appearance.rounding.full
- topLeftRadius: slider.implicitHeight / 15
- bottomLeftRadius: slider.implicitHeight / 15
+ topLeftRadius: root.implicitHeight / 15
+ bottomLeftRadius: root.implicitHeight / 15
}
}
handle: StyledRect {
- id: rect
-
- x: slider.visualPosition * slider.availableWidth
+ x: root.visualPosition * root.availableWidth - implicitWidth / 2
- implicitWidth: slider.implicitHeight / 4.5
- implicitHeight: slider.implicitHeight
+ implicitWidth: root.implicitHeight / 4.5
+ implicitHeight: root.implicitHeight
color: Colours.palette.m3primary
radius: Appearance.rounding.full
MouseArea {
anchors.fill: parent
+ acceptedButtons: Qt.NoButton
cursorShape: Qt.PointingHandCursor
- onPressed: event => event.accepted = false
}
}
}