summaryrefslogtreecommitdiff
path: root/components/controls/StyledRadioButton.qml
diff options
context:
space:
mode:
authorLaurens Duin <85798751+Laurens256@users.noreply.github.com>2025-08-05 08:04:53 +0200
committerGitHub <noreply@github.com>2025-08-05 16:04:53 +1000
commit9ada66a78ea58d8b498f1dd26bf0783e1a442c51 (patch)
tree60963034cc340b64cf25a63b3ce43483f5eb8d63 /components/controls/StyledRadioButton.qml
parentlauncher: allow wallpaper switch when exactly 2 wallpapers (#343) (diff)
downloadcaelestia-shell-9ada66a78ea58d8b498f1dd26bf0783e1a442c51.tar.gz
caelestia-shell-9ada66a78ea58d8b498f1dd26bf0783e1a442c51.tar.bz2
caelestia-shell-9ada66a78ea58d8b498f1dd26bf0783e1a442c51.zip
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>
Diffstat (limited to 'components/controls/StyledRadioButton.qml')
-rw-r--r--components/controls/StyledRadioButton.qml58
1 files changed, 58 insertions, 0 deletions
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
+ }
+}