matrixion/resources/qml/dialogs/ReCaptchaDialog.qml

61 lines
1.4 KiB
QML
Raw Normal View History

2023-06-29 00:00:34 +03:00
// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls
import im.nheko
ApplicationWindow {
id: recaptchaRoot
required property ReCaptcha recaptcha
function accept() {
recaptcha.confirm();
recaptchaRoot.close();
}
function reject() {
recaptcha.cancel();
recaptchaRoot.close();
}
color: palette.window
flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
height: msg.implicitHeight + footer.implicitHeight
2023-10-31 05:11:03 +03:00
title: recaptcha.context
2023-06-29 00:00:34 +03:00
width: Math.max(msg.implicitWidth, footer.implicitWidth)
footer: DialogButtonBox {
onAccepted: recaptchaRoot.accept()
onRejected: recaptchaRoot.reject()
Button {
text: qsTr("Open reCAPTCHA")
2023-10-31 05:11:03 +03:00
2023-06-29 00:00:34 +03:00
onClicked: recaptcha.openReCaptcha()
}
Button {
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
2023-10-31 05:11:03 +03:00
text: qsTr("Cancel")
2023-06-29 00:00:34 +03:00
}
Button {
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
2023-10-31 05:11:03 +03:00
text: qsTr("Confirm")
2023-06-29 00:00:34 +03:00
}
}
2023-10-31 05:11:03 +03:00
Shortcut {
sequence: StandardKey.Cancel
onActivated: recaptchaRoot.reject()
}
Label {
id: msg
anchors.fill: parent
padding: 8
text: qsTr("Solve the reCAPTCHA and press the confirm button")
}
2023-06-29 00:00:34 +03:00
}