refactor(ChatCommandModal): use StatusModal instead of ModalPopup
This commit is contained in:
parent
0739f78388
commit
85065b8d33
|
@ -4,32 +4,41 @@ import QtQuick.Layouts 1.13
|
|||
import QtQuick.Dialogs 1.3
|
||||
|
||||
import utils 1.0
|
||||
import "../../../../shared"
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
import StatusQ.Controls 0.1 as StatusQControls
|
||||
|
||||
import "../../../../shared/panels"
|
||||
import "../../../../shared/controls"
|
||||
import "../../../../shared/popups"
|
||||
import "../../../../shared/views"
|
||||
import "../../../../shared/status"
|
||||
// TODO: replace with StatusModal
|
||||
ModalPopup {
|
||||
|
||||
StatusModal {
|
||||
property string commandTitle: "Send"
|
||||
property string finalButtonLabel: "Request address"
|
||||
property var sendChatCommand: function () {}
|
||||
property bool isRequested: false
|
||||
|
||||
id: root
|
||||
title: root.commandTitle
|
||||
anchors.centerIn: parent
|
||||
header.title: root.commandTitle
|
||||
height: 504
|
||||
|
||||
property alias selectRecipient: selectRecipient
|
||||
|
||||
contentItem: Item {
|
||||
width: root.width
|
||||
height: childrenRect.height
|
||||
TransactionStackView {
|
||||
id: stack
|
||||
anchors.fill: parent
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 16
|
||||
anchors.leftMargin: Style.current.padding
|
||||
anchors.rightMargin: Style.current.padding
|
||||
|
||||
onGroupActivated: {
|
||||
root.title = group.headerText
|
||||
root.header.title = group.headerText
|
||||
btnNext.text = group.footerText
|
||||
}
|
||||
TransactionFormGroup {
|
||||
|
@ -38,7 +47,7 @@ ModalPopup {
|
|||
//% "Continue"
|
||||
footerText: qsTrId("continue")
|
||||
|
||||
AccountSelector {
|
||||
StatusQControls.StatusAccountSelector {
|
||||
id: selectFromAccount
|
||||
accounts: walletModel.accountsView.accounts
|
||||
selectedAccount: {
|
||||
|
@ -65,14 +74,14 @@ ModalPopup {
|
|||
icon.rotation: root.isRequested ? -90 : 90
|
||||
}
|
||||
|
||||
StyledText {
|
||||
StatusBaseText {
|
||||
id: addressRequiredInfo
|
||||
anchors.right: selectRecipient.right
|
||||
anchors.bottom: selectRecipient.top
|
||||
anchors.bottomMargin: -Style.current.padding
|
||||
//% "Address request required"
|
||||
text: qsTrId("address-request-required")
|
||||
color: Style.current.danger
|
||||
color: Theme.palette.dangerColor1
|
||||
visible: addressRequiredValidator.isWarn
|
||||
}
|
||||
|
||||
|
@ -136,14 +145,10 @@ ModalPopup {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: Item {
|
||||
width: parent.width
|
||||
height: btnNext.height
|
||||
|
||||
StatusRoundButton {
|
||||
id: btnBack
|
||||
anchors.left: parent.left
|
||||
leftButtons: [
|
||||
StatusQControls.StatusRoundButton {
|
||||
visible: !stack.isFirstGroup
|
||||
icon.name: "arrow-right"
|
||||
icon.width: 20
|
||||
|
@ -153,9 +158,11 @@ ModalPopup {
|
|||
stack.back()
|
||||
}
|
||||
}
|
||||
StatusButton {
|
||||
]
|
||||
|
||||
rightButtons: [
|
||||
StatusQControls.StatusButton {
|
||||
id: btnNext
|
||||
anchors.right: parent.right
|
||||
//% "Next"
|
||||
text: qsTrId("next")
|
||||
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||
|
@ -172,7 +179,7 @@ ModalPopup {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/*##^##
|
||||
|
|
|
@ -452,7 +452,7 @@ Item {
|
|||
isRequested: false
|
||||
//% "Send"
|
||||
commandTitle: qsTrId("command-button-send")
|
||||
title: commandTitle
|
||||
header.title: commandTitle
|
||||
//% "Request Address"
|
||||
finalButtonLabel: qsTrId("request-address")
|
||||
selectRecipient.selectedRecipient: {
|
||||
|
@ -480,7 +480,7 @@ Item {
|
|||
isRequested: true
|
||||
//% "Request"
|
||||
commandTitle: qsTrId("wallet-request")
|
||||
title: commandTitle
|
||||
header.title: commandTitle
|
||||
//% "Request"
|
||||
finalButtonLabel: qsTrId("wallet-request")
|
||||
selectRecipient.selectedRecipient: {
|
||||
|
|
Loading…
Reference in New Issue