From 9ada66a78ea58d8b498f1dd26bf0783e1a442c51 Mon Sep 17 00:00:00 2001 From: Laurens Duin <85798751+Laurens256@users.noreply.github.com> Date: Tue, 5 Aug 2025 08:04:53 +0200 Subject: bar/popouts: add audio device switcher (#319) * feat: basic audio switcher * feat: replace VerticalSlider with StyledSlider * fix: styling * fix: formatting * chore: make sound icons consistent, change slider styling * feat: styled slider component variants * chore: cleanup * chore: cleanup * fix: pr fixes * fix: remove redundant code * chore: remove old code * fix: controls styling * fixes * more tweaks * radiobtn: add interaction stuff Anim slider --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- modules/dashboard/Media.qml | 54 +++------------------------------------------ 1 file changed, 3 insertions(+), 51 deletions(-) (limited to 'modules/dashboard') diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml index c12db22..edb09af 100644 --- a/modules/dashboard/Media.qml +++ b/modules/dashboard/Media.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import qs.components import qs.components.effects import qs.components.misc +import qs.components.controls import qs.services import qs.utils import qs.config @@ -279,9 +280,10 @@ Item { } } - Slider { + StyledSlider { id: slider + enabled: !!Players.active implicitWidth: controls.implicitWidth * 1.5 implicitHeight: Appearance.padding.normal * 3 @@ -291,56 +293,6 @@ Item { if (active?.canSeek && active?.positionSupported) active.position = value * active.length; } - - 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 - - implicitWidth: slider.handle.x - slider.implicitHeight / 6 - - color: Colours.palette.m3primary - radius: Appearance.rounding.full - topRightRadius: slider.implicitHeight / 15 - bottomRightRadius: slider.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 - - implicitWidth: parent.width - slider.handle.x - slider.handle.implicitWidth - slider.implicitHeight / 6 - - color: Colours.palette.m3surfaceContainer - radius: Appearance.rounding.full - topLeftRadius: slider.implicitHeight / 15 - bottomLeftRadius: slider.implicitHeight / 15 - } - } - - handle: StyledRect { - id: rect - - x: slider.visualPosition * slider.availableWidth - - implicitWidth: slider.implicitHeight / 4.5 - implicitHeight: slider.implicitHeight - - color: Colours.palette.m3primary - radius: Appearance.rounding.full - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onPressed: event => event.accepted = false - } - } } Item { -- cgit v1.2.3-freya