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> --- components/controls/StyledRadioButton.qml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 components/controls/StyledRadioButton.qml (limited to 'components/controls/StyledRadioButton.qml') diff --git a/components/controls/StyledRadioButton.qml b/components/controls/StyledRadioButton.qml new file mode 100644 index 0000000..73fc836 --- /dev/null +++ b/components/controls/StyledRadioButton.qml @@ -0,0 +1,58 @@ +import qs.components +import qs.services +import qs.config +import QtQuick +import QtQuick.Controls + +RadioButton { + id: root + + font.pointSize: Appearance.font.size.smaller + + indicator: Rectangle { + id: outerCircle + + implicitWidth: 20 + implicitHeight: 20 + radius: Appearance.rounding.full + color: "transparent" + border.color: root.checked ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant + border.width: 2 + anchors.verticalCenter: parent.verticalCenter + + StateLayer { + anchors.margins: -Appearance.padding.smaller + color: root.checked ? Colours.palette.m3onSurface : Colours.palette.m3primary + z: -1 + + function onClicked(): void { + root.click(); + } + } + + StyledRect { + anchors.centerIn: parent + implicitWidth: 8 + implicitHeight: 8 + + radius: Appearance.rounding.full + color: root.checked ? Colours.palette.m3primary : "transparent" + } + + Behavior on border.color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } + + contentItem: StyledText { + text: root.text + font.pointSize: root.font.pointSize + anchors.verticalCenter: parent.verticalCenter + anchors.left: outerCircle.right + anchors.leftMargin: Appearance.spacing.smaller + } +} -- cgit v1.2.3-freya