/
v-str
/
cerera_android
Обзор
Документация
Войти
/
v-str
/
cerera_android
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
proj/qml/Components/ConfirmationDialog.qml
85 строк
2 KB
v-str
Подтверждение операций: ConfirmationDialog + safe-access Sensors
04 июл 2026, 23:01
Верифицирован
04 июл 2026, 23:01
2990190
Код
Авторство
О чём код?
import QtQuick import QtQuick.Controls import QtQuick.Layouts Popup { id: root property string message: "Подтвердите действие" property string confirmText: "Подтверждаю" property int confirmColorType: 0 signal confirmed() signal cancelled() modal: true closePolicy: Popup.NoAutoClose anchors.centerIn: Overlay.overlay Overlay.modal: Rectangle { color: Qt.rgba(0, 0, 0, 0.5) } padding: 20 background: Rectangle { radius: 8 color: Qt.rgba(0x11 / 255, 0x18 / 255, 0x27 / 255, 0.6) border.width: 0.5 border.color: Qt.rgba(1, 1, 1, 0.08) } FontMetrics { id: fm font.family: "Source Code Pro" font.pixelSize: 12 font.weight: Font.ExtraLight } readonly property real btnWidth: fm.advanceWidth("Отключение") + 30 contentItem: ColumnLayout { spacing: 12 implicitWidth: 280 Text { text: root.message color: SpaceMill.spaceTextMuted font.pixelSize: 13 wrapMode: Text.WordWrap Layout.fillWidth: true } RowLayout { spacing: 8 Layout.fillWidth: true Layout.topMargin: 4 AppTransparentButton { text: "Отмена" colorType: 3 font.pixelSize: 12 topPadding: 20; bottomPadding: 20 onDelayedClick: { root.cancelled() root.close() } } Item { Layout.fillWidth: true height: 1 } AppTransparentButton { text: root.confirmText Layout.preferredWidth: root.btnWidth colorType: root.confirmColorType font.pixelSize: 12 topPadding: 20; bottomPadding: 20 onDelayedClick: { root.confirmed() root.close() } } } } }