1
0

qml: UI: add most transaction fields to tx history page

This commit is contained in:
Sander van Grieken
2021-04-03 21:56:42 +02:00
parent a3801ecae8
commit 39048fdd10
5 changed files with 145 additions and 14 deletions

View File

@@ -0,0 +1,29 @@
import QtQuick 2.6
Item {
height: 60
property alias text: label.text
Rectangle {
anchors.fill: parent
color: '#cccccc'
}
Text {
id: label
x: 10
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 11
color: '#202020'
}
Rectangle {
x: 10
width: parent.width - 20
height: 2
anchors.topMargin: 0
anchors.top: label.bottom
color: '#808080'
}
}

View File

@@ -6,6 +6,11 @@ Item {
Column {
width: parent.width
EHeader {
text: "Network"
width: parent.width
}
Row {
Text { text: "Server: " }
Text { text: Network.server }

View File

@@ -6,6 +6,11 @@ Item {
Column {
width: parent.width
EHeader {
text: "Scan QR Code"
width: parent.width
}
Item {
id: voc
width: parent.width

View File

@@ -3,7 +3,7 @@ import QtQuick 2.0
Item {
Rectangle {
anchors.fill: parent
color: '#111111'
color: '#111144'
}
Image {

View File

@@ -2,38 +2,130 @@ import QtQuick 2.6
Item {
id: rootItem
// height: 800
Column {
width: parent.width
// height: parent.height
Text {
text: "Transactions"
EHeader {
text: "History"
width: parent.width
}
ListView {
width: parent.width
height: 200
// anchors.bottom: rootItem.bottom
model: Daemon.currentWallet.historyModel
delegate: Item {
id: delegate
width: parent.width
height: line.height
height: txinfo.height
MouseArea {
anchors.fill: delegate
onClicked: extinfo.visible = !extinfo.visible
}
Row {
id: line
id: txinfo
Rectangle {
width: 10
width: 4
height: parent.height
color: 'blue'
color: model.incoming ? 'green' : 'red'
}
Text {
leftPadding: 20
text: model.display
Column {
Row {
id: baseinfo
spacing: 10
Image {
readonly property variant tx_icons : [
"../../icons/unconfirmed.png",
"../../icons/clock1.png",
"../../icons/clock2.png",
"../../icons/clock3.png",
"../../icons/clock4.png",
"../../icons/clock5.png",
"../../icons/confirmed.png"
]
width: 32
height: 32
anchors.verticalCenter: parent.verticalCenter
source: tx_icons[Math.min(6,Math.floor(model.confirmations/20))]
}
Column {
id: content
width: delegate.width - x - valuefee.width
Text {
text: model.label !== '' ? model.label : '<no label>'
color: model.label !== '' ? 'black' : 'gray'
}
Text {
font.pointSize: 7
text: model.date
}
}
Column {
id: valuefee
width: delegate.width * 0.25
Text {
text: model.bc_value
}
Text {
font.pointSize: 7
text: 'fee: ' + (model.fee !== undefined ? model.fee : '0')
}
}
}
Row {
id: extinfo
visible: false
Column {
id: extinfoinner
Text {
font.pointSize: 6
text: 'txid: ' + model.txid
}
Text {
font.pointSize: 7
text: 'height: ' + model.height
}
Text {
font.pointSize: 7
text: 'confirmations: ' + model.confirmations
}
Text {
font.pointSize: 7
text: {
for (var i=0; i < Object.keys(model.outputs).length; i++) {
if (model.outputs[i].value === model.bc_value) {
return 'address: ' + model.outputs[i].address
}
}
}
}
}
}
}
}
}
} // delegate
}
EButton {
text: 'Back'
onClicked: app.stack.pop()
}
}
}