/
v-str
/
cerera_android
Обзор
Документация
Войти
/
v-str
/
cerera_android
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
proj/qml/Components/AppCheckBox.qml
57 строк
1 KB
v-str
Dashboard: вёрстка по описанию + Q_PROPERTY заглушки + Components модуль
04 июл 2026, 19:25
Верифицирован
04 июл 2026, 19:25
b8ed9f4
Код
Авторство
О чём код?
import QtQuick Item { id: root implicitWidth: indicatorRect.width + spacing + label.implicitWidth implicitHeight: Math.max(indicatorRect.height, label.implicitHeight) property string text: "" property bool checked: false property int spacing: 12 property bool enabled: true signal toggled(bool checked) Rectangle { id: indicatorRect width: 33 height: 33 radius: 8 color: "transparent" border.width: 0.75 border.color: root.enabled ? SpaceMill.spaceSuccess : SpaceMill.spaceTextMuted Rectangle { anchors.centerIn: parent width: 18 height: 18 radius: 5 color: root.enabled ? SpaceMill.spaceSuccess : SpaceMill.spaceTextMuted visible: root.checked } } Text { id: label anchors { left: indicatorRect.right leftMargin: root.spacing verticalCenter: indicatorRect.verticalCenter } text: root.text font.family: "Source Code Pro" font.weight: Font.ExtraLight font.pixelSize: 26 color: root.enabled ? SpaceMill.spaceSuccess : SpaceMill.spaceTextMuted } MouseArea { anchors.fill: parent onClicked: { if (root.enabled) { root.checked = !root.checked; root.toggled(root.checked); } } } }