From be371c8d88b20d1423a164daa5ccd827cd051ece Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 9 Jan 2023 17:38:07 +0100 Subject: [PATCH] qml: styling TxDetails --- electrum/gui/qml/components/TxDetails.qml | 37 +++++++---------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index 7bc97167c..c6fc2dc88 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/electrum/gui/qml/components/TxDetails.qml @@ -74,7 +74,6 @@ Pane { } Label { - Layout.fillWidth: true visible: !txdetails.isUnrelated && txdetails.lnAmount.satsInt == 0 text: txdetails.amount.satsInt > 0 ? qsTr('Amount received') @@ -92,23 +91,11 @@ Pane { wrapMode: Text.Wrap } - RowLayout { + FormattedAmount { visible: !txdetails.isUnrelated Layout.fillWidth: true - Label { - visible: txdetails.lnAmount.satsInt == 0 - text: Config.formatSats(txdetails.amount) - font.family: FixedFont - } - Label { - visible: txdetails.lnAmount.satsInt != 0 - text: Config.formatSats(txdetails.lnAmount) - font.family: FixedFont - } - Label { - text: Config.baseUnit - color: Material.accentColor - } + showAlt: false + amount: txdetails.lnAmount.isEmpty ? txdetails.amount : txdetails.lnAmount } Item { @@ -127,25 +114,22 @@ Pane { Label { - Layout.fillWidth: true - visible: txdetails.fee.satsInt != 0 + visible: !txdetails.fee.isEmpty text: qsTr('Transaction fee') color: Material.accentColor } RowLayout { Layout.fillWidth: true - visible: txdetails.fee.satsInt != 0 - Label { - text: Config.formatSats(txdetails.fee) - font.family: FixedFont - } - Label { + visible: !txdetails.fee.isEmpty + FormattedAmount { Layout.fillWidth: true - text: Config.baseUnit - color: Material.accentColor + amount: txdetails.fee + showAlt: false } FlatButton { + Layout.fillWidth: true + Layout.minimumWidth: implicitWidth icon.source: '../../icons/warning.png' icon.color: 'transparent' text: qsTr('Bump fee') @@ -162,6 +146,7 @@ Pane { } Label { + Layout.fillWidth: true text: qsTr('Status') color: Material.accentColor }