Files
z-bar-qt/Components/CustomRadioButton.qml
T
zach 25bee293b0
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 1m10s
Python / verify (pull_request) Successful in 1m53s
Rust / fmt (pull_request) Successful in 34s
Rust / clippy (pull_request) Successful in 57s
feat: fontbuilder to streamline font styling
2026-09-21 15:37:45 +02:00

54 lines
1.2 KiB
QML

import QtQuick
import QtQuick.Templates
import ZShell.Config
import qs.Services
RadioButton {
id: root
font: Tokens.font.body.medium
implicitHeight: Math.max(implicitIndicatorHeight, implicitContentHeight)
implicitWidth: implicitIndicatorWidth + implicitContentWidth + contentItem.anchors.leftMargin
contentItem: CustomText {
anchors.left: outerCircle.right
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
font: root.font
text: root.text
}
indicator: Rectangle {
id: outerCircle
anchors.verticalCenter: parent.verticalCenter
border.color: root.checked ? Colors.palette.m3primary : Colors.palette.m3onSurfaceVariant
border.width: 2
color: "transparent"
implicitHeight: 16
implicitWidth: 16
radius: Tokens.rounding.full
Behavior on border.color {
CAnim {}
}
StateLayer {
anchors.margins: -7
color: root.checked ? Colors.palette.m3onSurface : Colors.palette.m3primary
z: -1
onClicked: {
root.click();
}
}
CustomRect {
anchors.centerIn: parent
color: Qt.alpha(Colors.palette.m3primary, root.checked ? 1 : 0)
implicitHeight: 8
implicitWidth: 8
radius: Tokens.rounding.full
}
}
}