complete and refactor Fx preferences and use in Send/Receive tabs
This commit is contained in:
@@ -52,19 +52,19 @@ Pane {
|
||||
|
||||
TextField {
|
||||
id: amountFiat
|
||||
visible: Config.fiatCurrency != ''
|
||||
visible: Daemon.fx.fiatCurrency != ''
|
||||
font.family: FixedFont
|
||||
placeholderText: qsTr('Amount')
|
||||
inputMethodHints: Qt.ImhPreferNumbers
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: Config.fiatCurrency != ''
|
||||
text: Config.fiatCurrency
|
||||
visible: Daemon.fx.fiatCurrency != ''
|
||||
text: Daemon.fx.fiatCurrency
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Item { visible: Config.fiatCurrency == ''; height: 1; Layout.columnSpan: 2; Layout.fillWidth: true }
|
||||
Item { visible: Daemon.fx.fiatCurrency == ''; height: 1; Layout.columnSpan: 2; Layout.fillWidth: true }
|
||||
|
||||
Item { width: 1; height: 1 } // workaround colspan on baseunit messing up row above
|
||||
|
||||
@@ -115,22 +115,22 @@ Pane {
|
||||
if (amountFiat.activeFocus)
|
||||
return
|
||||
var a = Config.unitsToSats(amount.text)
|
||||
amountFiat.text = Daemon.fiatValue(a)
|
||||
amountFiat.text = Daemon.fx.fiatValue(a)
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: amountFiat
|
||||
function onTextChanged() {
|
||||
if (amountFiat.activeFocus) {
|
||||
amount.text = Daemon.satoshiValue(amountFiat.text)
|
||||
amount.text = Daemon.fx.satoshiValue(amountFiat.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: Network
|
||||
function onFiatUpdated() {
|
||||
target: Daemon.fx
|
||||
function onQuotesUpdated() {
|
||||
var a = Config.unitsToSats(amount.text)
|
||||
amountFiat.text = Daemon.fiatValue(a)
|
||||
amountFiat.text = Daemon.fx.fiatValue(a)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user