From 4071fe9726270cb0a4e65c2e1a6a04a668320515 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 9 Jan 2023 12:51:50 +0100 Subject: [PATCH] qml: fix prev --- .../components/controls/FormattedAmount.qml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 electrum/gui/qml/components/controls/FormattedAmount.qml diff --git a/electrum/gui/qml/components/controls/FormattedAmount.qml b/electrum/gui/qml/components/controls/FormattedAmount.qml new file mode 100644 index 000000000..43f1d1f83 --- /dev/null +++ b/electrum/gui/qml/components/controls/FormattedAmount.qml @@ -0,0 +1,24 @@ +import QtQuick 2.6 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Controls.Material 2.0 + +import org.electrum 1.0 + +RowLayout { + required property Amount amount + property bool showAlt: true + Label { + text: Config.formatSats(amount) + font.family: FixedFont + } + Label { + text: Config.baseUnit + color: Material.accentColor + } + + Label { + visible: showAlt && Daemon.fx.enabled + text: '(' + Daemon.fx.fiatValue(amount) + ' ' + Daemon.fx.fiatCurrency + ')' + } +}