diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/InvitationBubble.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/InvitationBubble.qml index a7eb2885db..009cc77ab5 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/InvitationBubble.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/InvitationBubble.qml @@ -54,7 +54,6 @@ Item { ConfirmationDialog { property string settingsProp: "" property var onConfirmed: (function(){}) - height: 310 showCancelButton: true //% "This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk." confirmationText: qsTrId("this-feature-is-experimental-and-is-meant-for-testing-purposes-by-core-contributors-and-the-community--it-s-not-meant-for-real-use-and-makes-no-claims-of-security-or-integrity-of-funds-or-data--use-at-your-own-risk-") diff --git a/ui/app/AppLayouts/Chat/ChatLayout.qml b/ui/app/AppLayouts/Chat/ChatLayout.qml index f4c9902d0c..88ad261d04 100644 --- a/ui/app/AppLayouts/Chat/ChatLayout.qml +++ b/ui/app/AppLayouts/Chat/ChatLayout.qml @@ -207,7 +207,7 @@ StatusAppThreePanelLayout { ConfirmationDialog { id: removeContactConfirmationDialog // % "Remove contact" - title: qsTrId("remove-contact") + header.title: qsTrId("remove-contact") //% "Are you sure you want to remove this contact?" confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-") onConfirmButtonClicked: { diff --git a/ui/app/AppLayouts/Chat/CommunityColumn.qml b/ui/app/AppLayouts/Chat/CommunityColumn.qml index eb76335f42..eab6bc61a7 100644 --- a/ui/app/AppLayouts/Chat/CommunityColumn.qml +++ b/ui/app/AppLayouts/Chat/CommunityColumn.qml @@ -298,7 +298,6 @@ Item { ConfirmationDialog { property string categoryId btnType: "warn" - height: 216 showCancelButton: true onClosed: { destroy() diff --git a/ui/app/AppLayouts/Chat/CommunityComponents/CreateCategoryPopup.qml b/ui/app/AppLayouts/Chat/CommunityComponents/CreateCategoryPopup.qml index f917e03b9f..346ada7f6c 100644 --- a/ui/app/AppLayouts/Chat/CommunityComponents/CreateCategoryPopup.qml +++ b/ui/app/AppLayouts/Chat/CommunityComponents/CreateCategoryPopup.qml @@ -178,7 +178,6 @@ StatusModal { id: deleteCategoryConfirmationDialogComponent ConfirmationDialog { btnType: "warn" - height: 216 showCancelButton: true onClosed: { destroy() diff --git a/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml b/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml index 93fe5da6b2..4a59cf04fa 100644 --- a/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml +++ b/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml @@ -61,7 +61,7 @@ ModalPopup { ConfirmationDialog { id: declineAllDialog //% "Decline all contacts" - title: qsTrId("decline-all-contacts") + header.title: qsTrId("decline-all-contacts") //% "Are you sure you want to decline all these contact requests" confirmationText: qsTrId("are-you-sure-you-want-to-decline-all-these-contact-requests") onConfirmButtonClicked: { @@ -78,7 +78,7 @@ ModalPopup { ConfirmationDialog { id: acceptAllDialog //% "Accept all contacts" - title: qsTrId("accept-all-contacts") + header.title: qsTrId("accept-all-contacts") //% "Are you sure you want to accept all these contact requests" confirmationText: qsTrId("are-you-sure-you-want-to-accept-all-these-contact-requests") onConfirmButtonClicked: { diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index 6af3030e36..fe61086206 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -219,7 +219,7 @@ StatusModal { ConfirmationDialog { id: removeContactConfirmationDialog - title: qsTr("Remove contact") + header.title: qsTr("Remove contact") confirmationText: qsTr("Are you sure you want to remove this contact?") onConfirmButtonClicked: { if (profileModel.contacts.isAdded(fromAuthor)) { diff --git a/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml b/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml index 7f43941711..e3793f2ebc 100644 --- a/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml @@ -197,7 +197,7 @@ ScrollView { id: confirmDialog //% "Warning!" - title: qsTrId("close-app-title") + header.title: qsTrId("close-app-title") //% "The account will be logged out. When you login again, the selected mode will be enabled" confirmationText: qsTrId("the-account-will-be-logged-out--when-you-login-again--the-selected-mode-will-be-enabled") onConfirmButtonClicked: { @@ -286,7 +286,6 @@ ScrollView { ConfirmationDialog { id: confirmationPopup property string settingsProp: "" - height: 310 showCancelButton: true //% "This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk." confirmationText: (settingsProp === "isWalletV2Enabled" ? qsTr("--DO NOT USE - UNDER ACTIVE DEVELOPMENT--\n") : "") + diff --git a/ui/app/AppLayouts/Profile/Sections/BackupSeedModal.qml b/ui/app/AppLayouts/Profile/Sections/BackupSeedModal.qml index 7f06c13000..a0b8a0dce1 100644 --- a/ui/app/AppLayouts/Profile/Sections/BackupSeedModal.qml +++ b/ui/app/AppLayouts/Profile/Sections/BackupSeedModal.qml @@ -199,7 +199,7 @@ ModalPopup { ConfirmationDialog { id: confirmPopup //% "Are you sure?" - title: qsTrId("are-you-sure?") + header.title: qsTrId("are-you-sure?") //% "You will not be able to see the whole seed phrase again" confirmationText: qsTrId("are-you-sure-description") onConfirmButtonClicked: { diff --git a/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml b/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml index 9b39a090ac..c1bc67f647 100644 --- a/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml +++ b/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml @@ -69,7 +69,7 @@ ListView { ConfirmationDialog { id: removeContactConfirmationDialog //% "Remove contact" - title: qsTrId("remove-contact") + header.title: qsTrId("remove-contact") //% "Are you sure you want to remove this contact?" confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-") onConfirmButtonClicked: { diff --git a/ui/app/AppLayouts/Profile/Sections/Ens/TermsAndConditions.qml b/ui/app/AppLayouts/Profile/Sections/Ens/TermsAndConditions.qml index 9d25dea54a..9b9b6f5e91 100644 --- a/ui/app/AppLayouts/Profile/Sections/Ens/TermsAndConditions.qml +++ b/ui/app/AppLayouts/Profile/Sections/Ens/TermsAndConditions.qml @@ -354,7 +354,6 @@ Item { ConfirmationDialog { id: confirmationPopup - height: 310 showCancelButton: true confirmationText: qsTr("This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk.") confirmButtonLabel: qsTr("I understand") diff --git a/ui/app/AppLayouts/Profile/Sections/FleetRadioSelector.qml b/ui/app/AppLayouts/Profile/Sections/FleetRadioSelector.qml index fd4a1dbbd7..d3930ca97b 100644 --- a/ui/app/AppLayouts/Profile/Sections/FleetRadioSelector.qml +++ b/ui/app/AppLayouts/Profile/Sections/FleetRadioSelector.qml @@ -23,7 +23,7 @@ StatusRadioButtonRow { id: confirmDialogComponent ConfirmationDialog { //% "Warning!" - title: qsTrId("close-app-title") + header.title: qsTrId("close-app-title") //% "Change fleet to %1" confirmationText: qsTrId("change-fleet-to--1").arg(newFleet) onConfirmButtonClicked: profileModel.fleets.setFleet(newFleet) diff --git a/ui/app/AppLayouts/Profile/Sections/LanguageModal.qml b/ui/app/AppLayouts/Profile/Sections/LanguageModal.qml index 6975b9b316..eefb6ceaa0 100644 --- a/ui/app/AppLayouts/Profile/Sections/LanguageModal.qml +++ b/ui/app/AppLayouts/Profile/Sections/LanguageModal.qml @@ -27,7 +27,7 @@ ModalPopup { active: Qt.platform.os === Constants.linux sourceComponent: ConfirmationDialog { property string newLocale - title: qsTr("Change language") + header.title: qsTr("Change language") confirmationText: qsTr("Display language has been changed. You must restart the application for changes to take effect.") showCancelButton: true confirmButtonLabel: qsTr("Close the app now") diff --git a/ui/app/AppLayouts/Profile/Sections/NetworkRadioSelector.qml b/ui/app/AppLayouts/Profile/Sections/NetworkRadioSelector.qml index 84c4b80ee0..a85cc08152 100644 --- a/ui/app/AppLayouts/Profile/Sections/NetworkRadioSelector.qml +++ b/ui/app/AppLayouts/Profile/Sections/NetworkRadioSelector.qml @@ -26,7 +26,7 @@ StatusRadioButtonRow { ConfirmationDialog { id: confirmDialog //% "Warning!" - title: qsTrId("close-app-title") + header.title: qsTrId("close-app-title") //% "The account will be logged out. When you unlock it again, the selected network will be used" confirmationText: qsTrId("logout-app-content") onConfirmButtonClicked: { diff --git a/ui/shared/ConfirmationDialog.qml b/ui/shared/ConfirmationDialog.qml index dfa3b2d3cd..e605838722 100644 --- a/ui/shared/ConfirmationDialog.qml +++ b/ui/shared/ConfirmationDialog.qml @@ -1,77 +1,100 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 -import "../imports" -import "../shared/status" -import "./" -ModalPopup { +import StatusQ.Core 0.1 +import StatusQ.Core.Theme 0.1 +import StatusQ.Controls 0.1 +import StatusQ.Popups 0.1 + +StatusModal { id: confirmationDialog + anchors.centerIn: parent property Popup parentPopup + property var value + property var executeConfirm + property var executeCancel property string btnType: "warn" + property string confirmButtonLabel: qsTr("Confirm") + property string cancelButtonLabel: qsTr("Cancel") + property string confirmationText: qsTr("Are you sure you want to do this?") property bool showCancelButton: false property alias checkbox: checkbox - height: 186 - width: 400 - //% "Confirm your action" - title: qsTrId("confirm-your-action") + header.title: qsTr("Confirm you action") focus: visible - //% "Confirm" - property string confirmButtonLabel: qsTrId("close-app-button") - //% "Cancel" - //% "Cancel" - property string cancelButtonLabel: qsTrId("browsing-cancel") - //% "Are you sure you want to this?" - property string confirmationText: qsTrId("are-you-sure-you-want-to-this-") - - property var value - signal confirmButtonClicked() signal cancelButtonClicked() - property var executeConfirm - property var executeCancel - Item { - anchors.fill: parent + contentItem: Item { + width: confirmationDialog.width + implicitHeight: childrenRect.height + Column { + width: parent.width - 32 + anchors.horizontalCenter: parent.horizontalCenter - StyledText { - id: innerText - text: confirmationDialog.confirmationText - font.pixelSize: 15 - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - } + Item { + width: parent.width + height: 16 + } - StatusCheckBox { - id: checkbox - visible: false - anchors.top: innerText.bottom - anchors.topMargin: Style.current.halfPadding - Layout.preferredWidth: parent.width - //% "Do not show this again" - text: qsTrId("do-not-show-this-again") + StatusBaseText { + text: confirmationDialog.confirmationText + font.pixelSize: 15 + anchors.left: parent.left + anchors.right: parent.right + wrapMode: Text.WordWrap + color: Theme.palette.directColor1 + } + + Item { + width: parent.width + height: 16 + } + + StatusCheckBox { + id: checkbox + visible: false + Layout.preferredWidth: parent.width + text: qsTr("Do not show this again") + } + + Item { + width: parent.width + height: visible ? 16 : 0 + visible: checkbox.visible + } } } - - footer: Item { - id: footerContainer - width: parent.width - height: confirmButton.height//children[0].height - + rightButtons: [ + StatusFlatButton { + id: cancelButton + visible: showCancelButton + text: confirmationDialog.cancelButtonLabel + onClicked: { + if (executeCancel && typeof executeCancel === "function") { + executeCancel() + } + confirmationDialog.cancelButtonClicked() + } + }, StatusButton { id: confirmButton - type: confirmationDialog.btnType - anchors.right: cancelButton.visible ? cancelButton.left : parent.right - anchors.rightMargin: cancelButton.visible ? Style.current.smallPadding : 0 + type: { + switch (confirmationDialog.btnType) { + case "warn": + return StatusBaseButton.Type.Danger + break + default: + return StatusBaseButton.Type.Primary + } + } text: confirmationDialog.confirmButtonLabel - anchors.bottom: parent.bottom focus: true Keys.onReturnPressed: function(event) { confirmButton.clicked() @@ -80,27 +103,8 @@ ModalPopup { if (executeConfirm && typeof executeConfirm === "function") { executeConfirm() } - confirmationDialog.confirmButtonClicked() } } - - StatusButton { - id: cancelButton - anchors.right: parent.right - visible: showCancelButton - anchors.rightMargin: Style.current.smallPadding - text: confirmationDialog.cancelButtonLabel - anchors.bottom: parent.bottom - onClicked: { - if (executeCancel && typeof executeCancel === "function") { - executeCancel() - } - confirmationDialog.cancelButtonClicked() - } - } - } + ] } - - - diff --git a/ui/shared/status/StatusChatCommandsPopup.qml b/ui/shared/status/StatusChatCommandsPopup.qml index 05f814404b..0850837223 100644 --- a/ui/shared/status/StatusChatCommandsPopup.qml +++ b/ui/shared/status/StatusChatCommandsPopup.qml @@ -62,7 +62,6 @@ Popup { ConfirmationDialog { id: confirmationPopup - height: 310 showCancelButton: true confirmationText: qsTr("This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk.") confirmButtonLabel: qsTr("I understand") diff --git a/ui/shared/status/StatusStickerMarket.qml b/ui/shared/status/StatusStickerMarket.qml index 5adab84031..8908ed9a8c 100644 --- a/ui/shared/status/StatusStickerMarket.qml +++ b/ui/shared/status/StatusStickerMarket.qml @@ -160,7 +160,6 @@ Item { ConfirmationDialog { id: confirmationPopup - height: 310 showCancelButton: true confirmationText: qsTr("This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk.") confirmButtonLabel: qsTr("I understand")