From 7b856f32a2f80a077667f731f66ac080ee63bccd Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 19 Apr 2021 09:29:19 +0200 Subject: [PATCH] add insufficient inputs feedback label --- drongo | 2 +- .../sparrow/wallet/PaymentController.java | 13 +++++++++---- .../com/sparrowwallet/sparrow/wallet/payment.fxml | 11 +++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drongo b/drongo index 891499af..1aeaacaf 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 891499aff04b69f53bf143464001b96b44a0ec53 +Subproject commit 1aeaacaf59484c76d5bf485dabb4a632c5230032 diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java index b7aaa9bc..abd67ff1 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java @@ -14,10 +14,7 @@ import com.sparrowwallet.drongo.wallet.UtxoSelector; import com.sparrowwallet.sparrow.AppServices; import com.sparrowwallet.sparrow.CurrencyRate; import com.sparrowwallet.sparrow.EventManager; -import com.sparrowwallet.sparrow.control.CoinTextFormatter; -import com.sparrowwallet.sparrow.control.CopyableTextField; -import com.sparrowwallet.sparrow.control.FiatLabel; -import com.sparrowwallet.sparrow.control.QRScanDialog; +import com.sparrowwallet.sparrow.control.*; import com.sparrowwallet.sparrow.event.BitcoinUnitChangedEvent; import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent; import com.sparrowwallet.sparrow.event.FiatCurrencySelectedEvent; @@ -59,6 +56,9 @@ public class PaymentController extends WalletFormController implements Initializ @FXML private FiatLabel fiatAmount; + @FXML + private Label amountStatus; + @FXML private ToggleButton maxButton; @@ -141,6 +141,11 @@ public class PaymentController extends WalletFormController implements Initializ sendController.utxoLabelSelectionProperty().addListener((observable, oldValue, newValue) -> { maxButton.setText("Max" + newValue); }); + amountStatus.managedProperty().bind(amountStatus.visibleProperty()); + amountStatus.setVisible(sendController.isInsufficientInputs()); + sendController.insufficientInputsProperty().addListener((observable, oldValue, newValue) -> { + amountStatus.setVisible(newValue); + }); Optional firstTab = sendController.getPaymentTabs().getTabs().stream().findFirst(); if(firstTab.isPresent()) { diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml index 2d19e81d..aed67c77 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml @@ -56,6 +56,17 @@