2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../controls"
|
2021-11-11 17:25:54 +00:00
|
|
|
import "../stores"
|
2020-05-28 13:49:28 +00:00
|
|
|
|
|
|
|
Item {
|
2022-07-19 13:17:35 +00:00
|
|
|
id: root
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
property string locale: ""
|
2021-10-21 08:22:05 +00:00
|
|
|
property string currency: ""
|
2021-10-05 20:50:22 +00:00
|
|
|
property var currentAccount
|
2022-01-31 13:29:27 +00:00
|
|
|
property var store
|
2022-02-15 13:19:45 +00:00
|
|
|
property var walletStore
|
2020-06-03 19:59:18 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
implicitHeight: childrenRect.height
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
GridLayout {
|
|
|
|
width: parent.width
|
|
|
|
rowSpacing: Style.current.halfPadding
|
|
|
|
columns: 2
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
// account + balance
|
|
|
|
Row {
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
StatusBaseText {
|
2022-07-18 08:37:37 +00:00
|
|
|
objectName: "accountName"
|
2022-07-19 13:17:35 +00:00
|
|
|
font.pixelSize: 28
|
|
|
|
font.bold: true
|
|
|
|
text: currentAccount.name
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
font.pixelSize: 28
|
|
|
|
font.bold: true
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: "%1 %2".arg(Utils.toLocaleString(root.currentAccount.currencyBalance.toFixed(2), root.locale, {"currency": true})).arg(root.currency.toUpperCase())
|
|
|
|
}
|
|
|
|
}
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
// network filter
|
|
|
|
NetworkFilter {
|
|
|
|
id: networkFilter
|
|
|
|
Layout.alignment: Qt.AlignTrailing
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.rowSpan: 2
|
|
|
|
store: root.walletStore
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
// account address button
|
|
|
|
Button {
|
|
|
|
horizontalPadding: Style.current.halfPadding
|
|
|
|
verticalPadding: 5
|
|
|
|
Layout.preferredWidth: 150
|
|
|
|
background: Rectangle {
|
|
|
|
implicitWidth: 150
|
|
|
|
implicitHeight: 32
|
|
|
|
color: "transparent"
|
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.baseColor2
|
|
|
|
radius: 36
|
|
|
|
}
|
2020-05-28 13:49:28 +00:00
|
|
|
|
2022-07-19 13:17:35 +00:00
|
|
|
contentItem: RowLayout {
|
|
|
|
spacing: 4
|
|
|
|
StatusIcon {
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.preferredWidth: 22
|
|
|
|
Layout.preferredHeight: 22
|
|
|
|
icon: "address"
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: currentAccount.mixedcaseAddress
|
|
|
|
color: Theme.palette.directColor5
|
|
|
|
elide: Text.ElideMiddle
|
|
|
|
font.pixelSize: Style.current.primaryTextFontSize
|
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClicked: store.copyToClipboard(currentAccount.mixedcaseAddress)
|
|
|
|
}
|
2022-02-15 13:19:45 +00:00
|
|
|
}
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|