add insufficient inputs feedback label

This commit is contained in:
Craig Raw
2021-04-19 09:29:19 +02:00
parent 42b96e042b
commit 7b856f32a2
3 changed files with 21 additions and 5 deletions
@@ -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<Tab> firstTab = sendController.getPaymentTabs().getTabs().stream().findFirst();
if(firstTab.isPresent()) {