1
0

UI history page

This commit is contained in:
Sander van Grieken
2022-04-06 17:00:29 +02:00
parent 6cb3a07500
commit bbaf0fe5db
2 changed files with 68 additions and 85 deletions

View File

@@ -21,4 +21,7 @@ QtObject {
readonly property int iconSizeLarge: 32 readonly property int iconSizeLarge: 32
readonly property int iconSizeXLarge: 48 readonly property int iconSizeXLarge: 48
readonly property int iconSizeXXLarge: 64 readonly property int iconSizeXXLarge: 64
property color colorCredit: "#ff80ff80"
property color colorDebit: "#ffff8080"
} }

View File

@@ -20,101 +20,81 @@ Pane {
delegate: Item { delegate: Item {
id: delegate id: delegate
width: ListView.view.width width: ListView.view.width
height: txinfo.height height: delegateLayout.height
MouseArea { ColumnLayout {
anchors.fill: delegate id: delegateLayout
onClicked: extinfo.visible = !extinfo.visible width: parent.width
} spacing: 0
GridLayout { Rectangle {
id: txinfo visible: index > 0
columns: 3
x: 6
width: delegate.width - 12
Image {
readonly property variant tx_icons : [
"../../../gui/icons/unconfirmed.png",
"../../../gui/icons/clock1.png",
"../../../gui/icons/clock2.png",
"../../../gui/icons/clock3.png",
"../../../gui/icons/clock4.png",
"../../../gui/icons/clock5.png",
"../../../gui/icons/confirmed.png"
]
Layout.preferredWidth: 32
Layout.preferredHeight: 32
Layout.alignment: Qt.AlignVCenter
Layout.rowSpan: 2
source: tx_icons[Math.min(6,model.confirmations)]
}
Label {
font.pixelSize: 18
Layout.fillWidth: true Layout.fillWidth: true
text: model.label !== '' ? model.label : '<no label>' Layout.preferredHeight: constants.paddingSmall
color: model.label !== '' ? Material.accentColor : 'gray' color: Qt.rgba(0,0,0,0.10)
}
Label {
id: valueLabel
font.family: FixedFont
font.pixelSize: 15
text: Config.formatSats(model.bc_value)
font.bold: true
color: model.incoming ? "#ff80ff80" : "#ffff8080"
}
Label {
font.pixelSize: 12
text: model.date
}
Label {
font.pixelSize: 10
text: 'fee: ' + (model.fee !== undefined ? model.fee : '0')
} }
GridLayout {
id: extinfo
visible: false
columns: 2
Layout.columnSpan: 3
Label { text: 'txid' } ItemDelegate {
Label { Layout.fillWidth: true
font.pixelSize: 10 Layout.preferredHeight: txinfo.height
text: model.txid
elide: Text.ElideMiddle GridLayout {
Layout.fillWidth: true id: txinfo
} columns: 3
Label { text: 'height' }
Label { x: constants.paddingSmall
font.pixelSize: 10 width: delegate.width - 2*constants.paddingSmall
text: model.height
} Item { Layout.columnSpan: 3; Layout.preferredWidth: 1; Layout.preferredHeight: 1}
Label { text: 'confirmations' } Image {
Label { readonly property variant tx_icons : [
font.pixelSize: 10 "../../../gui/icons/unconfirmed.png",
text: model.confirmations "../../../gui/icons/clock1.png",
} "../../../gui/icons/clock2.png",
Label { text: 'address' } "../../../gui/icons/clock3.png",
Label { "../../../gui/icons/clock4.png",
font.pixelSize: 10 "../../../gui/icons/clock5.png",
elide: Text.ElideMiddle "../../../gui/icons/confirmed.png"
Layout.fillWidth: true ]
text: {
for (var i=0; i < Object.keys(model.outputs).length; i++) { Layout.preferredWidth: constants.iconSizeLarge
if (model.outputs[i].value === model.bc_value) { Layout.preferredHeight: constants.iconSizeLarge
return model.outputs[i].address Layout.alignment: Qt.AlignVCenter
} Layout.rowSpan: 2
} source: tx_icons[Math.min(6,model.confirmations)]
} }
Label {
font.pixelSize: constants.fontSizeLarge
Layout.fillWidth: true
text: model.label !== '' ? model.label : '<no label>'
color: model.label !== '' ? Material.accentColor : 'gray'
wrapMode: Text.Wrap
maximumLineCount: 2
elide: Text.ElideRight
}
Label {
id: valueLabel
font.family: FixedFont
font.pixelSize: constants.fontSizeMedium
text: Config.formatSats(model.bc_value)
font.bold: true
color: model.incoming ? constants.colorCredit : constants.colorDebit
}
Label {
font.pixelSize: constants.fontSizeSmall
text: model.date
}
Label {
font.pixelSize: constants.fontSizeXSmall
Layout.alignment: Qt.AlignRight
text: model.fee !== undefined ? 'fee: ' + model.fee : ''
}
Item { Layout.columnSpan: 3; Layout.preferredWidth: 1; Layout.preferredHeight: 1 }
} }
} }
} }
// as the items in the model are not bindings to QObjects, // as the items in the model are not bindings to QObjects,
// hook up events that might change the appearance // hook up events that might change the appearance
Connections { Connections {