mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-06 21:54:19 -04:00
Make "Show all" default
This commit is contained in:
parent
c5656ee9ac
commit
dd8d300496
2 changed files with 8 additions and 4 deletions
|
@ -170,6 +170,8 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
|
||||||
paymentMethodColumn.setComparator((o1, o2) -> o1.getOffer().getPaymentMethod().compareTo(o2.getOffer().getPaymentMethod()));
|
paymentMethodColumn.setComparator((o1, o2) -> o1.getOffer().getPaymentMethod().compareTo(o2.getOffer().getPaymentMethod()));
|
||||||
avatarColumn.setComparator((o1, o2) -> o1.getOffer().getOwnerNodeAddress().hostName.compareTo(o2.getOffer().getOwnerNodeAddress().hostName));
|
avatarColumn.setComparator((o1, o2) -> o1.getOffer().getOwnerNodeAddress().hostName.compareTo(o2.getOffer().getOwnerNodeAddress().hostName));
|
||||||
|
|
||||||
|
priceColumn.sortableProperty().bind(model.showAllTradeCurrenciesProperty.not());
|
||||||
|
|
||||||
createOfferButton = addButton(root, ++gridRow, "");
|
createOfferButton = addButton(root, ++gridRow, "");
|
||||||
createOfferButton.setMinHeight(40);
|
createOfferButton.setMinHeight(40);
|
||||||
createOfferButton.setPadding(new Insets(0, 20, 0, 20));
|
createOfferButton.setPadding(new Insets(0, 20, 0, 20));
|
||||||
|
|
|
@ -89,11 +89,12 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||||
// If id is empty string we ignore filter (display all methods)
|
// If id is empty string we ignore filter (display all methods)
|
||||||
|
|
||||||
PaymentMethod selectedPaymentMethod = new PaymentMethod(SHOW_ALL_FLAG, 0, 0, null);
|
PaymentMethod selectedPaymentMethod = new PaymentMethod(SHOW_ALL_FLAG, 0, 0, null);
|
||||||
|
private CryptoCurrency showAllCurrenciesItem = new CryptoCurrency(SHOW_ALL_FLAG, SHOW_ALL_FLAG);
|
||||||
|
|
||||||
private final ObservableList<OfferBookListItem> offerBookListItems;
|
private final ObservableList<OfferBookListItem> offerBookListItems;
|
||||||
private final ListChangeListener<OfferBookListItem> listChangeListener;
|
private final ListChangeListener<OfferBookListItem> listChangeListener;
|
||||||
private boolean isTabSelected;
|
private boolean isTabSelected;
|
||||||
final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty();
|
final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty(true);
|
||||||
boolean showAllPaymentMethods = true;
|
boolean showAllPaymentMethods = true;
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +153,7 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||||
private void fillAllTradeCurrencies() {
|
private void fillAllTradeCurrencies() {
|
||||||
allTradeCurrencies.clear();
|
allTradeCurrencies.clear();
|
||||||
// Used for ignoring filter (show all)
|
// Used for ignoring filter (show all)
|
||||||
allTradeCurrencies.add(new CryptoCurrency(SHOW_ALL_FLAG, SHOW_ALL_FLAG));
|
allTradeCurrencies.add(showAllCurrenciesItem);
|
||||||
allTradeCurrencies.addAll(preferences.getTradeCurrenciesAsObservable());
|
allTradeCurrencies.addAll(preferences.getTradeCurrenciesAsObservable());
|
||||||
allTradeCurrencies.add(new CryptoCurrency(EDIT_FLAG, EDIT_FLAG));
|
allTradeCurrencies.add(new CryptoCurrency(EDIT_FLAG, EDIT_FLAG));
|
||||||
}
|
}
|
||||||
|
@ -186,10 +187,11 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||||
|
|
||||||
public void onSetTradeCurrency(TradeCurrency tradeCurrency) {
|
public void onSetTradeCurrency(TradeCurrency tradeCurrency) {
|
||||||
String code = tradeCurrency.getCode();
|
String code = tradeCurrency.getCode();
|
||||||
showAllTradeCurrenciesProperty.set(isShowAllEntry(code));
|
boolean showAllEntry = isShowAllEntry(code);
|
||||||
|
showAllTradeCurrenciesProperty.set(showAllEntry);
|
||||||
if (isEditEntry(code))
|
if (isEditEntry(code))
|
||||||
navigation.navigateTo(MainView.class, SettingsView.class, PreferencesView.class);
|
navigation.navigateTo(MainView.class, SettingsView.class, PreferencesView.class);
|
||||||
else if (!showAllTradeCurrenciesProperty.get()) {
|
else if (!showAllEntry) {
|
||||||
this.selectedTradeCurrency = tradeCurrency;
|
this.selectedTradeCurrency = tradeCurrency;
|
||||||
tradeCurrencyCode.set(code);
|
tradeCurrencyCode.set(code);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue