status-desktop/ui/shared/ConfirmationDialog.qml

71 lines
1.8 KiB
QML
Raw Normal View History

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../imports"
import "../shared/status"
import "./"
ModalPopup {
id: confirmationDialog
2020-10-02 13:02:56 +00:00
property Popup parentPopup
property string btnType: "warn"
property bool showCancelButton: false
2020-10-02 13:02:56 +00:00
height: 186
width: 400
2020-08-26 15:52:26 +00:00
//% "Confirm your action"
title: qsTrId("confirm-your-action")
2020-08-26 15:52:26 +00:00
//% "Confirm"
property string confirmButtonLabel: qsTrId("close-app-button")
//% "Cancel"
property string cancelButtonLabel: qsTr("Cancel")
2020-08-26 15:52:26 +00:00
//% "Are you sure you want to this?"
property string confirmationText: qsTrId("are-you-sure-you-want-to-this-")
2020-10-02 13:02:56 +00:00
2020-10-02 14:37:51 +00:00
property var value
signal confirmButtonClicked()
signal cancelButtonClicked()
StyledText {
id: innerText
text: confirmationDialog.confirmationText
font.pixelSize: 15
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
}
footer: Item {
id: footerContainer
width: parent.width
height: confirmButton.height//children[0].height
StatusButton {
id: confirmButton
type: confirmationDialog.btnType
anchors.right: cancelButton.left
anchors.rightMargin: Style.current.smallPadding
text: confirmationDialog.confirmButtonLabel
anchors.bottom: parent.bottom
onClicked: confirmationDialog.confirmButtonClicked()
}
StatusButton {
id: cancelButton
anchors.right: parent.right
visible: showCancelButton
anchors.rightMargin: Style.current.smallPadding
text: confirmationDialog.cancelButtonLabel
anchors.bottom: parent.bottom
onClicked: confirmationDialog.cancelButtonClicked()
}
}
}