mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46: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();
|
addValidation();
|
||||||
|
|
||||||
addPaymentTab();
|
addPaymentTab();
|
||||||
Platform.runLater(() -> {
|
initializeTabHeader(0);
|
||||||
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");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
paymentTabs.getTabs().addListener((ListChangeListener<Tab>) c -> {
|
paymentTabs.getTabs().addListener((ListChangeListener<Tab>) c -> {
|
||||||
if(tabHeader != null) {
|
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) {
|
public BitcoinUnit getBitcoinUnit(BitcoinUnit bitcoinUnit) {
|
||||||
BitcoinUnit unit = bitcoinUnit;
|
BitcoinUnit unit = bitcoinUnit;
|
||||||
if(unit == null || unit.equals(BitcoinUnit.AUTO)) {
|
if(unit == null || unit.equals(BitcoinUnit.AUTO)) {
|
||||||
|
|
Loading…
Reference in a new issue