2020-05-28 14:54:42 +00:00
|
|
|
import QtQuick 2.3
|
2020-06-17 22:58:39 +00:00
|
|
|
import "./Components"
|
2020-06-16 09:46:26 +00:00
|
|
|
import "../../../imports"
|
2020-05-28 14:54:42 +00:00
|
|
|
|
|
|
|
Item {
|
2020-06-16 09:46:26 +00:00
|
|
|
Component {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: transactionListItemCmp
|
2020-06-16 09:46:26 +00:00
|
|
|
|
2020-06-17 16:02:33 +00:00
|
|
|
Rectangle {
|
|
|
|
id: transactionListItem
|
|
|
|
property bool isHovered: false
|
2020-06-16 09:46:26 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
height: 64
|
2020-06-17 16:02:33 +00:00
|
|
|
color: isHovered ? "#f0f0f0" : "white"
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: transactionModal.open()
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
transactionListItem.isHovered = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
transactionListItem.isHovered = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TransactionModal{
|
|
|
|
id: transactionModal
|
|
|
|
}
|
2020-06-16 09:46:26 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: assetIcon
|
|
|
|
color: "gray"
|
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 12
|
|
|
|
radius: 50
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: transferIcon
|
|
|
|
anchors.topMargin: 25
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: assetIcon.right
|
|
|
|
anchors.leftMargin: 22
|
|
|
|
height: 15
|
|
|
|
width: 15
|
|
|
|
color: to != walletModel.currentAccount.address ? "#4360DF" : "green"
|
|
|
|
text: to != walletModel.currentAccount.address ? "↑" : "↓"
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: transactionValue
|
|
|
|
anchors.left: transferIcon.right
|
|
|
|
anchors.leftMargin: Theme.smallPadding
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.bigPadding
|
|
|
|
font.pixelSize: 15
|
|
|
|
text: value + " TOKEN"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
anchors.right: timeInfo.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.bigPadding
|
|
|
|
width: children[0].width + children[1].width
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: to != walletModel.currentAccount.address ? "To " : "From "
|
|
|
|
anchors.right: addressValue.left
|
|
|
|
color: Theme.darkGrey
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: addressValue
|
|
|
|
text: to
|
|
|
|
width: 100
|
|
|
|
elide: Text.ElideMiddle
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: timeInfo
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Theme.bigPadding
|
|
|
|
width: children[0].width + children[1].width + children[2].width
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: "• "
|
|
|
|
font.weight: Font.Bold
|
|
|
|
anchors.right: timeIndicator.left
|
|
|
|
color: Theme.darkGrey
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: timeIndicator
|
|
|
|
text: "At "
|
|
|
|
anchors.right: timeValue.left
|
|
|
|
color: Theme.darkGrey
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: timeValue
|
|
|
|
text: timestamp
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.topMargin: 20
|
|
|
|
anchors.fill: parent
|
|
|
|
model: walletModel.transactions
|
|
|
|
delegate: transactionListItemCmp
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
2020-06-17 16:02:33 +00:00
|
|
|
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
2020-06-17 22:58:39 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|