mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Unify tab handling
This commit is contained in:
parent
89926d1efb
commit
3ce374e7bb
3 changed files with 10 additions and 6 deletions
|
@ -250,32 +250,32 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
|||
}
|
||||
if (viewClass == BtcOfferBookView.class) {
|
||||
btcOfferBookView = (BtcOfferBookView) viewLoader.load(BtcOfferBookView.class);
|
||||
btcOfferBookTab.setContent(btcOfferBookView.getRoot());
|
||||
btcOfferBookView.setOfferActionHandler(offerActionHandler);
|
||||
btcOfferBookView.setDirection(direction);
|
||||
tabPane.getSelectionModel().select(btcOfferBookTab);
|
||||
btcOfferBookView.onTabSelected(true);
|
||||
tabPane.getSelectionModel().select(btcOfferBookTab);
|
||||
btcOfferBookTab.setContent(btcOfferBookView.getRoot());
|
||||
} else if (viewClass == BsqOfferBookView.class) {
|
||||
bsqOfferBookView = (BsqOfferBookView) viewLoader.load(BsqOfferBookView.class);
|
||||
bsqOfferBookView.setOfferActionHandler(offerActionHandler);
|
||||
bsqOfferBookView.setDirection(direction);
|
||||
bsqOfferBookView.onTabSelected(true);
|
||||
tabPane.getSelectionModel().select(bsqOfferBookTab);
|
||||
bsqOfferBookTab.setContent(bsqOfferBookView.getRoot());
|
||||
bsqOfferBookView.onTabSelected(true);
|
||||
} else if (viewClass == TopAltcoinOfferBookView.class) {
|
||||
topAltcoinOfferBookView = (TopAltcoinOfferBookView) viewLoader.load(TopAltcoinOfferBookView.class);
|
||||
topAltcoinOfferBookView.setOfferActionHandler(offerActionHandler);
|
||||
topAltcoinOfferBookView.setDirection(direction);
|
||||
topAltcoinOfferBookView.onTabSelected(true);
|
||||
tabPane.getSelectionModel().select(topAltcoinOfferBookTab);
|
||||
topAltcoinOfferBookTab.setContent(topAltcoinOfferBookView.getRoot());
|
||||
topAltcoinOfferBookView.onTabSelected(true);
|
||||
} else if (viewClass == OtherOfferBookView.class) {
|
||||
otherOfferBookView = (OtherOfferBookView) viewLoader.load(OtherOfferBookView.class);
|
||||
otherOfferBookView.setOfferActionHandler(offerActionHandler);
|
||||
otherOfferBookView.setDirection(direction);
|
||||
otherOfferBookView.onTabSelected(true);
|
||||
tabPane.getSelectionModel().select(otherOfferBookTab);
|
||||
otherOfferBookTab.setContent(otherOfferBookView.getRoot());
|
||||
otherOfferBookView.onTabSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -601,11 +601,15 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
|||
}
|
||||
|
||||
public void onTabSelected(boolean isSelected) {
|
||||
if (model.isTabSelected == isSelected) {
|
||||
return;
|
||||
}
|
||||
model.onTabSelected(isSelected);
|
||||
|
||||
if (isSelected) {
|
||||
updateCurrencyComboBoxFromModel();
|
||||
root.requestFocus();
|
||||
updateCreateOfferButton();
|
||||
}
|
||||
updateCreateOfferButton();
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
|
||||
PaymentMethod selectedPaymentMethod = getShowAllEntryForPaymentMethod();
|
||||
|
||||
private boolean isTabSelected;
|
||||
boolean isTabSelected;
|
||||
final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty(true);
|
||||
final BooleanProperty disableMatchToggle = new SimpleBooleanProperty();
|
||||
final IntegerProperty maxPlacesForAmount = new SimpleIntegerProperty();
|
||||
|
|
Loading…
Add table
Reference in a new issue