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-05-14 16:16:01 +00:00
|
|
|
id: walletInfoContainer
|
|
|
|
|
2020-06-09 14:51:38 +00:00
|
|
|
Rectangle {
|
|
|
|
id: walletInfoHeader
|
2020-05-27 15:41:40 +00:00
|
|
|
anchors.left: parent.left
|
2020-06-09 14:51:38 +00:00
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
height: walletValueTextContainer.y + walletValueTextContainer.height + Theme.padding
|
|
|
|
color: Theme.white
|
|
|
|
z: 1
|
|
|
|
border.width: 0
|
2020-05-14 16:16:01 +00:00
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-09 14:51:38 +00:00
|
|
|
id: title
|
|
|
|
x: 143
|
|
|
|
y: 16
|
|
|
|
text: qsTr("Wallet")
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.padding
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pixelSize: 17
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: walletValueTextContainer
|
|
|
|
x: 16
|
|
|
|
y: 52
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Theme.padding
|
|
|
|
anchors.top: title.bottom
|
|
|
|
anchors.topMargin: Theme.padding
|
|
|
|
height: walletAmountValue.height + totalValue.height
|
|
|
|
|
2020-06-19 18:21:02 +00:00
|
|
|
StyledTextEdit {
|
2020-06-09 14:51:38 +00:00
|
|
|
id: walletAmountValue
|
|
|
|
color: "black"
|
|
|
|
text: walletModel.totalFiatBalance
|
|
|
|
selectByMouse: true
|
|
|
|
cursorVisible: true
|
|
|
|
readOnly: true
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 1
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 30
|
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-09 14:51:38 +00:00
|
|
|
id: totalValue
|
|
|
|
color: Theme.darkGrey
|
|
|
|
text: "Total value"
|
|
|
|
anchors.left: walletAmountValue.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.top: walletAmountValue.bottom
|
|
|
|
anchors.topMargin: 0
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 13
|
|
|
|
}
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|
|
|
|
|
2020-06-25 15:09:44 +00:00
|
|
|
AddAccount {
|
|
|
|
anchors.topMargin: 3
|
|
|
|
anchors.top: walletValueTextContainer.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Theme.padding
|
|
|
|
|
|
|
|
}
|
2020-06-09 14:51:38 +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
|
|
|
|
color: selected ? Theme.blue : Theme.transparent
|
|
|
|
radius: Theme.radius
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Theme.padding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Theme.padding
|
|
|
|
|
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
|
|
|
|
anchors.topMargin: Theme.smallPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Theme.padding
|
|
|
|
source: "../../img/walletIcon.svg"
|
|
|
|
}
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: walletIcon
|
|
|
|
source: walletIcon
|
2020-06-22 21:04:16 +00:00
|
|
|
color: selected || !iconColor ? Theme.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
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.smallPadding
|
|
|
|
anchors.left: walletIcon.right
|
|
|
|
anchors.leftMargin: 10
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: selected ? Theme.white : Theme.black
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletAddress
|
|
|
|
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
|
|
|
|
anchors.bottomMargin: Theme.smallPadding
|
|
|
|
anchors.left: walletName.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: selected ? Theme.white : Theme.darkGrey
|
|
|
|
opacity: selected ? 0.7 : 1
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-27 19:53:36 +00:00
|
|
|
id: walletBalance
|
|
|
|
text: balance
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.smallPadding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Theme.padding
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: selected ? Theme.white : Theme.black
|
|
|
|
}
|
|
|
|
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-06-09 14:51:38 +00:00
|
|
|
anchors.top: walletInfoHeader.bottom
|
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
|
|
|
}
|
|
|
|
##^##*/
|