mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Resize action column if it contains own offers
This commit is contained in:
parent
9e4b43a8a1
commit
e84c94f2b7
@ -143,6 +143,7 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||
private AutoTooltipTableColumn<OfferBookListItem, OfferBookListItem> depositColumn;
|
||||
private AutoTooltipTableColumn<OfferBookListItem, OfferBookListItem> signingStateColumn;
|
||||
private AutoTooltipTableColumn<OfferBookListItem, OfferBookListItem> avatarColumn;
|
||||
private TableColumn<OfferBookListItem, OfferBookListItem> actionColumn;
|
||||
private TableView<OfferBookListItem> tableView;
|
||||
|
||||
private int gridRow = 0;
|
||||
@ -261,8 +262,9 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||
tableView.getColumns().add(depositColumn);
|
||||
signingStateColumn = getSigningStateColumn();
|
||||
tableView.getColumns().add(signingStateColumn);
|
||||
actionColumn = getActionColumn();
|
||||
tableView.getColumns().add(actionColumn);
|
||||
avatarColumn = getAvatarColumn();
|
||||
tableView.getColumns().add(getActionColumn());
|
||||
tableView.getColumns().add(avatarColumn);
|
||||
|
||||
tableView.getSortOrder().add(priceColumn);
|
||||
@ -438,6 +440,8 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||
currencySelectionSubscriber = currencySelectionBinding.subscribe((observable, oldValue, newValue) -> {
|
||||
});
|
||||
|
||||
updateActionColumn();
|
||||
|
||||
tableView.setItems(model.getOfferList());
|
||||
|
||||
model.getOfferList().addListener(offerListListener);
|
||||
@ -1309,5 +1313,10 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||
getTradeCurrencyCode()).toUpperCase());
|
||||
}
|
||||
|
||||
private void updateActionColumn() {
|
||||
boolean hasOwnOffers = model.getOfferList().stream().anyMatch(offerBookListItem -> model.isMyOffer(offerBookListItem.getOffer()));
|
||||
actionColumn.setMinWidth(hasOwnOffers ? 180 : 90);
|
||||
}
|
||||
|
||||
abstract String getTradeCurrencyCode();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user