mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
add recursive lookup for tab header
This commit is contained in:
parent
f826c2d423
commit
bcd2c966a5
1 changed files with 16 additions and 9 deletions
|
@ -150,15 +150,7 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
addValidation();
|
||||
|
||||
addPaymentTab();
|
||||
Platform.runLater(() -> {
|
||||
StackPane stackPane = (StackPane)paymentTabs.lookup(".tab-header-area");
|
||||
if(stackPane != null) {
|
||||
tabHeader = stackPane;
|
||||
tabHeader.managedProperty().bind(tabHeader.visibleProperty());
|
||||
tabHeader.setVisible(false);
|
||||
paymentTabs.getStyleClass().remove("initial");
|
||||
}
|
||||
});
|
||||
initializeTabHeader(0);
|
||||
|
||||
paymentTabs.getTabs().addListener((ListChangeListener<Tab>) c -> {
|
||||
if(tabHeader != null) {
|
||||
|
@ -279,6 +271,21 @@ public class SendController extends WalletFormController implements Initializabl
|
|||
});
|
||||
}
|
||||
|
||||
private void initializeTabHeader(int count) {
|
||||
final int lookupCount = count;
|
||||
Platform.runLater(() -> {
|
||||
StackPane stackPane = (StackPane)paymentTabs.lookup(".tab-header-area");
|
||||
if(stackPane != null) {
|
||||
tabHeader = stackPane;
|
||||
tabHeader.managedProperty().bind(tabHeader.visibleProperty());
|
||||
tabHeader.setVisible(false);
|
||||
paymentTabs.getStyleClass().remove("initial");
|
||||
} else if(lookupCount < 20) {
|
||||
initializeTabHeader(lookupCount+1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public BitcoinUnit getBitcoinUnit(BitcoinUnit bitcoinUnit) {
|
||||
BitcoinUnit unit = bitcoinUnit;
|
||||
if(unit == null || unit.equals(BitcoinUnit.AUTO)) {
|
||||
|
|
Loading…
Reference in a new issue