Skip to content

Commit

Permalink
Merge pull request #3040 from axpoems/imp-user-profile-card-offer-table
Browse files Browse the repository at this point in the history
Fine tune offers table in profile card
  • Loading branch information
axpoems authored Dec 5, 2024
2 parents e7104e6 + 414fc83 commit 735bb3a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void configTableView() {
BisqTableColumn<OfferbookListItem> marketColumn = new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.market"))
.left()
.minWidth(90)
.comparator(Comparator.comparing(OfferbookListItem::getMarketCurrencyCode)
.thenComparing(OfferbookListItem::getOfferAgeInDays))
.setCellFactory(getMarketCellFactory())
Expand All @@ -86,41 +87,44 @@ private void configTableView() {

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.offerAge"))
.left()
.minWidth(60)
.comparator(Comparator.comparing(OfferbookListItem::getOfferAgeInDays))
.setCellFactory(getOfferAgeCellFactory())
.build());

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.offer"))
.left()
.minWidth(80)
.comparator(Comparator.comparing(OfferbookListItem::getOfferType))
.valueSupplier(OfferbookListItem::getOfferType)
.build());

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.amount"))
.left()
.right()
.minWidth(150)
.comparator(Comparator.comparing(OfferbookListItem::getQuoteSideMinAmount))
.valueSupplier(OfferbookListItem::getFormattedRangeQuoteAmount)
.build());

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.price"))
.right()
.minWidth(90)
.comparator(Comparator.comparing(OfferbookListItem::getPriceSpecAsPercent))
.setCellFactory(getPriceCellFactory())
.build());

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.title(Res.get("user.profileCard.offers.table.columns.paymentMethods"))
.left()
.right()
.minWidth(210)
.isSortable(false)
.setCellFactory(getPaymentMethodsCellFactory())
.build());

tableView.getColumns().add(new BisqTableColumn.Builder<OfferbookListItem>()
.left()
.minWidth(100)
.isSortable(false)
.setCellFactory(getGotToOfferCellFactory())
.build());
Expand Down Expand Up @@ -214,8 +218,7 @@ protected void updateItem(OfferbookListItem item, boolean empty) {
if (item != null && !empty) {
HBox paymentMethodsBox = BisqEasyViewUtils.getPaymentAndSettlementMethodsBox(
item.getFiatPaymentMethods(), item.getBitcoinPaymentMethods());
paymentMethodsBox.setAlignment(Pos.CENTER_LEFT);
paymentMethodsBox.setPadding(new Insets(0, 10, 0, 0));
paymentMethodsBox.setAlignment(Pos.CENTER_RIGHT);
setGraphic(paymentMethodsBox);
} else {
setGraphic(null);
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/desktop/src/main/resources/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
-fx-pref-height: 25;
}

.profile-card .profile-card-table.table-view .column-header .label {
-fx-alignment: center;
}

.profile-card .profile-card-table.table-view .column-header-background {
-fx-background-color: -bisq-dark-grey-30;
-fx-padding: 0 0 3 0;
Expand Down
2 changes: 1 addition & 1 deletion i18n/src/main/resources/user.properties
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ user.profileCard.offers.table.columns.offer=Offer
user.profileCard.offers.table.columns.amount=Amount
user.profileCard.offers.table.columns.price=Price
user.profileCard.offers.table.columns.paymentMethods=Payment methods
user.profileCard.offers.table.columns.offerAge=Offer age
user.profileCard.offers.table.columns.offerAge=Age
user.profileCard.offers.table.columns.offerAge.tooltip=Creation date:\n{0}
user.profileCard.offers.table.columns.goToOffer.button=Go to offer

0 comments on commit 735bb3a

Please sign in to comment.