2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2020-05-14 16:16:01 +00:00
|
|
|
import "../../../imports"
|
|
|
|
import "../../../shared"
|
2020-06-04 20:56:44 +00:00
|
|
|
import "./components"
|
2020-05-14 16:16:01 +00:00
|
|
|
|
2020-05-27 18:40:58 +00:00
|
|
|
Item {
|
2020-06-03 19:59:18 +00:00
|
|
|
property int selectedAccount: 0
|
2020-06-10 20:21:23 +00:00
|
|
|
property var changeSelectedAccount: function(newIndex) {
|
|
|
|
if (newIndex > walletModel.accounts) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
selectedAccount = newIndex
|
|
|
|
walletModel.setCurrentAccountByIndex(newIndex)
|
2020-09-04 15:37:38 +00:00
|
|
|
walletTabBar.currentIndex = 0;
|
2020-06-10 20:21:23 +00:00
|
|
|
}
|
2020-05-14 16:16:01 +00:00
|
|
|
id: walletInfoContainer
|
|
|
|
|
|
|
|
|
2020-06-09 14:51:38 +00:00
|
|
|
|
2020-07-15 19:38:03 +00:00
|
|
|
StyledText {
|
|
|
|
id: title
|
|
|
|
//% "Wallet"
|
|
|
|
text: qsTrId("wallet")
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pixelSize: 17
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: walletValueTextContainer
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.top: title.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
height: childrenRect.height
|
|
|
|
|
|
|
|
StyledTextEdit {
|
|
|
|
id: walletAmountValue
|
|
|
|
color: Style.current.textColor
|
2020-09-16 11:11:31 +00:00
|
|
|
text: Utils.toLocaleString(walletModel.totalFiatBalance, appSettings.locale) + " " + walletModel.defaultCurrency.toUpperCase()
|
2020-07-15 19:38:03 +00:00
|
|
|
selectByMouse: true
|
|
|
|
cursorVisible: true
|
|
|
|
readOnly: true
|
2020-06-09 14:51:38 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-15 19:38:03 +00:00
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 30
|
|
|
|
}
|
2020-06-09 14:51:38 +00:00
|
|
|
|
2020-07-15 19:38:03 +00:00
|
|
|
StyledText {
|
|
|
|
id: totalValue
|
|
|
|
color: Style.current.darkGrey
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Total value"
|
|
|
|
text: qsTrId("wallet-total-value")
|
2020-07-15 19:38:03 +00:00
|
|
|
anchors.left: walletAmountValue.left
|
|
|
|
anchors.top: walletAmountValue.bottom
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 13
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|
|
|
|
|
2020-06-25 15:09:44 +00:00
|
|
|
AddAccount {
|
2020-07-15 19:38:03 +00:00
|
|
|
anchors.top: parent.top
|
2020-06-25 15:09:44 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
}
|
2020-06-09 14:51:38 +00:00
|
|
|
}
|
2020-05-27 19:53:36 +00:00
|
|
|
|
2020-07-15 19:38:03 +00:00
|
|
|
|
2020-05-27 19:53:36 +00:00
|
|
|
Component {
|
|
|
|
id: walletDelegate
|
|
|
|
|
|
|
|
Rectangle {
|
2020-06-03 19:59:18 +00:00
|
|
|
property bool selected: index == selectedAccount
|
2020-05-27 19:53:36 +00:00
|
|
|
|
|
|
|
id: rectangle
|
|
|
|
height: 64
|
2020-07-02 15:14:31 +00:00
|
|
|
color: selected ? Style.current.blue : Style.current.transparent
|
|
|
|
radius: Style.current.radius
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-05-27 19:53:36 +00:00
|
|
|
|
2020-06-25 13:23:17 +00:00
|
|
|
SVGImage {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletIcon
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
anchors.top: parent.top
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-05-27 19:53:36 +00:00
|
|
|
source: "../../img/walletIcon.svg"
|
|
|
|
}
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: walletIcon
|
|
|
|
source: walletIcon
|
2020-07-02 15:14:31 +00:00
|
|
|
color: selected || !iconColor ? Style.current.white : iconColor // change image color
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletName
|
|
|
|
text: name
|
2020-08-14 19:19:08 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
anchors.right: walletBalance.left
|
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.top: parent.top
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.left: walletIcon.right
|
2020-08-14 19:19:08 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
|
2020-05-27 19:53:36 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
2020-07-13 18:45:54 +00:00
|
|
|
color: selected ? Style.current.white : Style.current.textColor
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletAddress
|
2020-07-02 15:14:31 +00:00
|
|
|
font.family: Style.current.fontHexRegular.name
|
2020-05-27 19:53:36 +00:00
|
|
|
text: address
|
2020-06-02 20:10:48 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: parent.width/2
|
|
|
|
elide: Text.ElideMiddle
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.bottomMargin: Style.current.smallPadding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.left: walletName.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: selected ? Style.current.white : Style.current.darkGrey
|
2020-05-27 19:53:36 +00:00
|
|
|
opacity: selected ? 0.7 : 1
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletBalance
|
2020-09-16 11:11:31 +00:00
|
|
|
text: Utils.toLocaleString(fiatBalance, appSettings.locale) + " " + walletModel.defaultCurrency.toUpperCase()
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.top: parent.top
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-05-27 19:53:36 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-05-27 19:53:36 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
2020-07-13 18:45:54 +00:00
|
|
|
color: selected ? Style.current.white : Style.current.textColor
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2020-06-10 20:21:23 +00:00
|
|
|
changeSelectedAccount(index)
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: listView
|
2020-06-05 20:18:25 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2020-07-15 19:38:03 +00:00
|
|
|
anchors.top: walletValueTextContainer.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
2020-05-27 19:53:36 +00:00
|
|
|
spacing: 5
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
|
|
|
delegate: walletDelegate
|
|
|
|
|
2020-06-02 20:10:48 +00:00
|
|
|
ListModel {
|
|
|
|
id: exampleWalletModel
|
2020-05-27 19:53:36 +00:00
|
|
|
ListElement {
|
|
|
|
name: "Status account"
|
2020-06-02 20:10:48 +00:00
|
|
|
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
2020-05-27 19:53:36 +00:00
|
|
|
balance: "12.00 USD"
|
2020-06-02 20:10:48 +00:00
|
|
|
iconColor: "#7CDA00"
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ListElement {
|
|
|
|
name: "Test account 1"
|
|
|
|
address: "0x2Ef1...E0Ba"
|
|
|
|
balance: "12.00 USD"
|
2020-06-02 20:10:48 +00:00
|
|
|
iconColor: "#FA6565"
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
name: "Status account"
|
|
|
|
address: "0x2Ef1...E0Ba"
|
|
|
|
balance: "12.00 USD"
|
2020-06-02 20:10:48 +00:00
|
|
|
iconColor: "#7CDA00"
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-02 20:10:48 +00:00
|
|
|
|
2020-06-03 19:59:18 +00:00
|
|
|
model: walletModel.accounts
|
2020-06-09 14:51:38 +00:00
|
|
|
// model: exampleWalletModel
|
2020-05-27 19:53:36 +00:00
|
|
|
}
|
2020-06-09 14:51:38 +00:00
|
|
|
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|
2020-05-14 20:04:38 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-06-09 14:51:38 +00:00
|
|
|
D{i:0;formeditorColor:"#ffffff";formeditorZoom:0.75;height:770;width:340}
|
2020-05-14 20:04:38 +00:00
|
|
|
}
|
|
|
|
##^##*/
|