Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Markets and Offer List columns collapsible #2133

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -993,4 +993,36 @@ public static Timeline pulse(Node node, double duration, double delay,
public static boolean getUseAnimations() {
return settingsService.getUseAnimations().get();
}

public static void expansionAnimation(Pane pane, double initialWidth, double finalWidth) {
expansionAnimation(pane, initialWidth, finalWidth, null);
}

public static void expansionAnimation(Pane pane, double initialWidth, double finalWidth, @Nullable Runnable finishedHandler) {
if (getUseAnimations()) {
Timeline widthExpansion = new Timeline(
new KeyFrame(Duration.millis(0),
new KeyValue(pane.prefWidthProperty(), initialWidth, Interpolator.LINEAR),
new KeyValue(pane.minWidthProperty(), initialWidth, Interpolator.LINEAR),
new KeyValue(pane.maxWidthProperty(), initialWidth, Interpolator.LINEAR)
),
new KeyFrame(Duration.millis(200),
new KeyValue(pane.prefWidthProperty(), finalWidth, Interpolator.EASE_OUT),
new KeyValue(pane.minWidthProperty(), finalWidth, Interpolator.EASE_OUT),
new KeyValue(pane.maxWidthProperty(), finalWidth, Interpolator.EASE_OUT)
)
);
widthExpansion.play();
if (finishedHandler != null) {
widthExpansion.setOnFinished(actionEvent -> finishedHandler.run());
}
} else {
pane.setPrefWidth(finalWidth);
pane.setMinWidth(finalWidth);
pane.setMaxWidth(finalWidth);
if (finishedHandler != null) {
finishedHandler.run();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ void onSelectOfferMessageItem(OfferMessageItem item) {
return MARKET_SELECTION_LIST_CELL_HEIGHT;
}

void toggleOfferList() {
model.getShowOfferListExpanded().set(!model.getShowOfferListExpanded().get());
}

void toggleMarketSelectionList() {
model.getShowMarketSelectionListExpanded().set(!model.getShowMarketSelectionListExpanded().get());
}

private void createMarketChannels() {
List<MarketChannelItem> marketChannelItems = bisqEasyOfferbookChannelService.getChannels().stream()
.map(MarketChannelItem::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public final class BisqEasyOfferbookModel extends ChatModel {
private final ToggleGroup filterOfferMessageMenuItemToggleGroup = new ToggleGroup();
private final StringProperty fiatAmountTitle = new SimpleStringProperty();
private final BooleanProperty showBuyFromOfferMessageItems = new SimpleBooleanProperty(true); // TODO: save user pref in settings
private final BooleanProperty showOfferListExpanded = new SimpleBooleanProperty(true); // TODO: save user pref in settings
private final BooleanProperty showMarketSelectionListExpanded = new SimpleBooleanProperty(true); // TODO: save user pref in settings

@Setter
private Predicate<MarketChannelItem> marketPricePredicate = marketChannelItem -> true;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public final class ChatMessageListItem<M extends ChatMessage, C extends ChatChan
private final MarketPriceService marketPriceService;
private final UserIdentityService userIdentityService;
@EqualsAndHashCode.Exclude
@Setter
private final BooleanProperty showHighlighted = new SimpleBooleanProperty();

public ChatMessageListItem(M chatMessage,
Expand Down
29 changes: 29 additions & 0 deletions apps/desktop/desktop/src/main/resources/css/bisq_easy.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,35 @@
-fx-text-fill: -bisq2-red-lit-40;
}

/* COLLAPSE AND EXPAND COLUMNS */
.collapsed-offer-list-container {
-fx-background-color: -bisq-dark-grey-20;
-fx-background-radius: 0 8 0 0;
}

.collapsed-market-selection-list-container {
-fx-background-color: -bisq-dark-grey-20;
-fx-background-radius: 8 0 0 0;
}

.chat-container-with-offer-list-collapsed {
-fx-background-radius: 8 0 0 0;
}

.chat-container-with-market-selection-list-collapsed {
-fx-background-radius: 0 8 0 0;
}

.chat-container-with-both-lists-collapsed {
-fx-background-radius: 0;
}

.chat-container-with-offer-list-collapsed,
.chat-container-with-market-selection-list-collapsed,
.chat-container-with-both-lists-collapsed {
-fx-background-color: -bisq-dark-grey-20;
}

.create-offer-button {
-fx-background-color: -fx-default-button;
-fx-text-fill: -fx-light-text-color;
Expand Down
24 changes: 24 additions & 0 deletions apps/desktop/desktop/src/main/resources/css/images.css
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,30 @@
-fx-image: url("/images/icons/sort-white.png");
}

#list-view-green {
-fx-image: url("/images/icons/list-view/list-view-green.png");
}

#list-view-white {
-fx-image: url("/images/icons/list-view/list-view-white.png");
}

#list-view-grey {
-fx-image: url("/images/icons/list-view/list-view-grey.png");
}

#market-green {
-fx-image: url("/images/icons/market/market-green.png");
}

#market-white {
-fx-image: url("/images/icons/market/market-white.png");
}

#market-grey {
-fx-image: url("/images/icons/market/market-grey.png");
}


/* ------------------------------------------------------------------------------------ */
/* Chat */
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions i18n/src/main/resources/bisq_easy.properties
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ bisqEasy.walletGuide.receive.link2=Bluewallet tutorial by BTC Sessions
######################################################

bisqEasy.offerbook.markets=Markets
bisqEasy.offerbook.markets.CollapsedList.Tooltip=Expand Markets
bisqEasy.offerbook.markets.ExpandedList.Tooltip=Collapse Markets
bisqEasy.offerbook.marketListCell.numOffers.one={0} offer
bisqEasy.offerbook.marketListCell.numOffers.many={0} offers
bisqEasy.offerbook.marketListCell.numOffers.tooltip.none=No offers yet available in the {0} market
Expand Down Expand Up @@ -439,6 +441,8 @@ bisqEasy.offerbook.dropdownMenu.filterOffersByPeerReputation.atLeastOneStar=1 st
bisqEasy.offerbook.chatMessage.deleteOffer.confirmation=Are you sure you want to delete this offer?

bisqEasy.offerbook.offerList=Offer List
bisqEasy.offerbook.offerList.CollapsedList.Tooltip=Expand Offer List
bisqEasy.offerbook.offerList.ExpandedList.Tooltip=Collapse Offer List
bisqEasy.offerbook.offerList.table.columns.peerProfile=Peer profile
bisqEasy.offerbook.offerList.table.columns.price=Price
bisqEasy.offerbook.offerList.table.columns.fiatAmount={0} amount
Expand Down
Loading