mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 16:24:53 +00:00
various minor ui improvements
This commit is contained in:
@@ -110,7 +110,7 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||
}
|
||||
|
||||
revalidate(amount, amountListener);
|
||||
maxButton.setDisable(!isValidRecipientAddress());
|
||||
maxButton.setDisable(!isValidAddressAndLabel());
|
||||
sendController.updateTransaction();
|
||||
|
||||
if(validationSupport != null) {
|
||||
@@ -119,6 +119,7 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||
});
|
||||
|
||||
label.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
maxButton.setDisable(!isValidAddressAndLabel());
|
||||
sendController.getCreateButton().setDisable(sendController.getWalletTransaction() == null || newValue == null || newValue.isEmpty() || sendController.isInsufficientFeeRate());
|
||||
sendController.updateTransaction();
|
||||
});
|
||||
@@ -136,7 +137,7 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||
}
|
||||
});
|
||||
|
||||
maxButton.setDisable(!isValidRecipientAddress());
|
||||
maxButton.setDisable(!isValidAddressAndLabel());
|
||||
sendController.utxoLabelSelectionProperty().addListener((observable, oldValue, newValue) -> {
|
||||
maxButton.setText("Max" + newValue);
|
||||
});
|
||||
@@ -175,6 +176,10 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidAddressAndLabel() {
|
||||
return isValidRecipientAddress() && !label.getText().isEmpty();
|
||||
}
|
||||
|
||||
private Address getRecipientAddress() throws InvalidAddressException {
|
||||
return Address.fromString(address.getText());
|
||||
}
|
||||
|
||||
@@ -125,14 +125,19 @@ public class ReceiveController extends WalletFormController implements Initializ
|
||||
if(AppServices.isConnected() && currentOutputs.isEmpty()) {
|
||||
lastUsed.setText("Never");
|
||||
lastUsed.setGraphic(getUnusedGlyph());
|
||||
address.getStyleClass().remove("error");
|
||||
} else if(!currentOutputs.isEmpty()) {
|
||||
long count = currentOutputs.size();
|
||||
BlockTransactionHashIndex lastUsedReference = currentOutputs.stream().skip(count - 1).findFirst().get();
|
||||
lastUsed.setText(lastUsedReference.getHeight() <= 0 ? "Unconfirmed Transaction" : DATE_FORMAT.format(lastUsedReference.getDate()));
|
||||
lastUsed.setGraphic(getWarningGlyph());
|
||||
if(!address.getStyleClass().contains("error")) {
|
||||
address.getStyleClass().add("error");
|
||||
}
|
||||
} else {
|
||||
lastUsed.setText("Unknown");
|
||||
lastUsed.setGraphic(null);
|
||||
address.getStyleClass().remove("error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user