Files
z-bar-qt/Modules/Settings/Common/TimeDialogToggle.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

72 lines
1.4 KiB
QML

import QtQuick
import QtQuick.Layouts
import ZShell.Config
import qs.Components
import qs.Modules.Settings
import qs.Services
ConnectedRect {
id: root
property alias checked: switchButton.checked
property int horizontalPadding: Tokens.padding.largeIncreased
property alias subtext: subtext.text
property alias text: text.text
property alias icon: icon
property string iconText: "open_in_new"
property int verticalPadding: Tokens.padding.small
signal clicked(event: MouseEvent)
signal toggled(checked: bool)
Layout.fillWidth: true
implicitHeight: layout.implicitHeight + verticalPadding * 2
Column {
id: layout
anchors.left: parent.left
anchors.leftMargin: root.horizontalPadding
anchors.right: icon.left
anchors.rightMargin: Tokens.padding.small
anchors.verticalCenter: parent.verticalCenter
CustomText {
id: text
font: Tokens.font.body.small
}
CustomText {
id: subtext
color: Colors.palette.m3outline
font: Tokens.font.label.small
wrapMode: Text.WordWrap
}
}
MaterialIcon {
id: icon
anchors.right: switchButton.left
anchors.rightMargin: Tokens.spacing.medium
anchors.verticalCenter: parent.verticalCenter
text: root.iconText
}
StateLayer {
onClicked: e => root.clicked(e)
}
CustomSwitch {
id: switchButton
anchors.right: parent.right
anchors.rightMargin: root.horizontalPadding
anchors.verticalCenter: parent.verticalCenter
onClicked: root.toggled(checked)
}
}