2020-08-14 19:19:08 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
import "../../../../shared"
|
2021-10-14 10:12:22 +00:00
|
|
|
import "../../../../shared/controls"
|
2021-10-14 11:33:34 +00:00
|
|
|
import "../../../../shared/popups"
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../stores"
|
2020-08-14 19:19:08 +00:00
|
|
|
|
2021-10-14 11:07:19 +00:00
|
|
|
// TODO: replace with StatusModal
|
2020-08-14 19:19:08 +00:00
|
|
|
ModalPopup {
|
2020-08-20 04:45:29 +00:00
|
|
|
property alias selectedAccount: accountSelector.selectedAccount
|
2020-08-14 19:19:08 +00:00
|
|
|
id: popup
|
|
|
|
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Receive"
|
|
|
|
title: qsTrId("receive")
|
2020-08-14 19:19:08 +00:00
|
|
|
height: 500
|
|
|
|
width: 500
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: qrCodeBox
|
|
|
|
height: 240
|
|
|
|
width: 240
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
radius: Style.current.radius
|
|
|
|
border.width: 1
|
|
|
|
border.color: Style.current.border
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: qrCodeImage
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
height: parent.height - Style.current.padding
|
|
|
|
width: parent.width - Style.current.padding
|
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AccountSelector {
|
|
|
|
id: accountSelector
|
|
|
|
label: ""
|
|
|
|
showAccountDetails: false
|
2021-10-05 20:50:22 +00:00
|
|
|
accounts: RootStore.accounts
|
|
|
|
currency: RootStore.defaultCurrency
|
2020-08-14 19:19:08 +00:00
|
|
|
anchors.top: qrCodeBox.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: 240
|
2020-08-13 08:24:51 +00:00
|
|
|
dropdownWidth: parent.width - (Style.current.padding * 2)
|
|
|
|
dropdownAlignment: Select.MenuAlignment.Center
|
2020-08-20 04:45:29 +00:00
|
|
|
onSelectedAccountChanged: {
|
|
|
|
if (selectedAccount.address) {
|
2021-10-05 20:50:22 +00:00
|
|
|
qrCodeImage.source = RootStore.getQrCode(selectedAccount.address)
|
2020-08-20 04:45:29 +00:00
|
|
|
txtWalletAddress.text = selectedAccount.address
|
|
|
|
}
|
|
|
|
}
|
2020-08-14 19:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Input {
|
2021-04-13 15:06:15 +00:00
|
|
|
id: txtWalletAddress
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Wallet address"
|
|
|
|
label: qsTrId("wallet-address")
|
2020-08-14 19:19:08 +00:00
|
|
|
anchors.top: accountSelector.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
copyToClipboard: true
|
|
|
|
textField.readOnly: true
|
|
|
|
customHeight: 56
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|