Browse Source

add insufficient inputs feedback label

terminal
Craig Raw 4 years ago
parent
commit
7b856f32a2
  1. 2
      drongo
  2. 13
      src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java
  3. 11
      src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml

2
drongo

@ -1 +1 @@
Subproject commit 891499aff04b69f53bf143464001b96b44a0ec53
Subproject commit 1aeaacaf59484c76d5bf485dabb4a632c5230032

13
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<Tab> firstTab = sendController.getPaymentTabs().getTabs().stream().findFirst();
if(firstTab.isPresent()) {

11
src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml

@ -56,6 +56,17 @@
</ComboBox>
<Label style="-fx-pref-width: 15" />
<FiatLabel fx:id="fiatAmount" />
<Label fx:id="amountStatus" text="Insufficient">
<tooltip>
<Tooltip text="Insufficient confirmed transaction value" />
</tooltip>
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="EXCLAMATION_CIRCLE" styleClass="failure" />
</graphic>
<padding>
<Insets left="10" />
</padding>
</Label>
<Region style="-fx-pref-width: 20" />
<ToggleButton fx:id="maxButton" text="Max" onAction="#setMaxInput" />
</Field>

Loading…
Cancel
Save