add wavyline slider to dash media widget

This commit is contained in:
2026-08-17 21:01:04 +02:00
parent db76ae7dc6
commit 98fc9aa97a
2 changed files with 145 additions and 149 deletions
+5 -2
View File
@@ -13,11 +13,13 @@ Slider {
property bool animateWave
property color bgColor: enabled ? Colors.palette.m3secondaryContainer : Qt.alpha(Colors.palette.m3onSurface, 0.1)
readonly property bool dragging: mouse.pressed
property color fgColor: enabled ? Colors.palette.m3primary : Qt.alpha(Colors.palette.m3onSurface, 0.38)
property real filledWidth
property alias inset: inset
property color insetColor: enabled ? (inset.attached ? Colors.palette.m3onSecondaryContainer : Colors.palette.m3onPrimary) : Colors.palette.m3onSurface
property string insetIcon: ""
property bool interactionOnMove: true
property real pos: visualPosition
property int radius: Tokens.rounding.small
property int waveDuration: 1000
@@ -139,7 +141,7 @@ Slider {
CAnim {
}
}
Anim on waveProgress {
NumberAnimation on waveProgress {
duration: root.waveDuration
easing.type: Easing.Linear
from: 0
@@ -186,7 +188,8 @@ Slider {
onPositionChanged: e => {
dragMovement = (e.x - pressStartX) / width;
root.interaction(posBinding.value);
if (root.interactionOnMove)
root.interaction(posBinding.value);
}
onPressed: e => {
widthBehavior.enabled = false;