From 6ed9c9869e24d02aad9944d37ac2c91ff4d5aa06 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 22 Oct 2025 22:16:45 +0200 Subject: [PATCH] styledslider: make marks with any range --- .../quickshell/ii/modules/common/widgets/StyledSlider.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index 5473d4628..a3fe23387 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -73,12 +73,13 @@ Slider { component TrackDot: Rectangle { required property real value + property real normalizedValue: (value - root.from) / (root.to - root.from) anchors.verticalCenter: parent.verticalCenter - x: root.handleMargins + (value * root.effectiveDraggingWidth) - (root.trackDotSize / 2) + x: root.handleMargins + (normalizedValue * root.effectiveDraggingWidth) - (root.trackDotSize / 2) width: root.trackDotSize height: root.trackDotSize radius: Appearance.rounding.full - color: value > root.visualPosition ? root.dotColor : root.dotColorHighlighted + color: normalizedValue > root.visualPosition ? root.dotColor : root.dotColorHighlighted Behavior on color { animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)