Files
zach 501e866a68
C++ / fmt (pull_request) Successful in 5s
JS/TS / fmt (pull_request) Successful in 26s
JS/TS / lint (pull_request) Successful in 29s
Python / lint (pull_request) Successful in 33s
Python / fmt (pull_request) Successful in 35s
Python / test (pull_request) Successful in 58s
Python / typecheck (pull_request) Failing after 1m8s
Rust / fmt (pull_request) Successful in 46s
C++ / build (pull_request) Successful in 2m22s
Rust / build (pull_request) Successful in 1m31s
Python / buildcheck (pull_request) Successful in 2m18s
Rust / clippy (pull_request) Successful in 1m26s
C++ / clang-tidy (pull_request) Successful in 3m55s
fix font & greeter bin
2026-08-13 21:22:21 +02:00

93 lines
2.0 KiB
QML

import QtQuick
import QtQuick.Layouts
import qs.Components
import ZShell.Config
import qs.Services
CustomSwitch {
id: root
readonly property alias bg: bg
property alias first: bg.first
property alias last: bg.last
property string settingAnchor
property string subtext
function flashHighlight(): void {
bg.flashHighlight();
}
Layout.fillWidth: true
cLayer: 2
horizontalPadding: Tokens.padding.largeIncreased
implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2
implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2
indicator.anchors.right: right
indicator.anchors.rightMargin: root.horizontalPadding
indicator.anchors.verticalCenter: verticalCenter
verticalPadding: Tokens.padding.normal
background: ConnectedRect {
id: bg
StateLayer {
id: stateLayer
manualPressOverride: root.pressed
}
}
contentItem: Item {
anchors.left: parent.left
anchors.leftMargin: root.horizontalPadding
anchors.right: root.indicator.left
anchors.rightMargin: Tokens.spacing.normal
implicitHeight: column.implicitHeight
implicitWidth: column.implicitWidth
Column {
id: column
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 0
CustomText {
id: label
anchors.left: parent.left
anchors.right: parent.right
elide: Text.ElideRight
font.pointSize: Tokens.font.size.smaller
opacity: root.enabled ? 1 : 0.5
text: root.text
Behavior on opacity {
Anim {
}
}
}
CustomText {
id: subtext
anchors.left: parent.left
anchors.right: parent.right
color: Colors.palette.m3outline
elide: Text.ElideRight
font.pointSize: Tokens.font.size.small
opacity: root.enabled ? 1 : 0.5
text: root.subtext
visible: root.subtext
Behavior on opacity {
Anim {
}
}
}
}
}
onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY)
}