From 61faf15deedb0f7c266ddc12fea22bf97bd5f9d3 Mon Sep 17 00:00:00 2001 From: axpoems <145597137+axpoems@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:13:32 +0100 Subject: [PATCH] Always show 'Go to offer' button and add delay to highlight --- .../offerbook/BisqEasyOfferbookController.java | 3 ++- .../offers/ProfileCardOffersView.java | 18 ------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/offerbook/BisqEasyOfferbookController.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/offerbook/BisqEasyOfferbookController.java index 1611891b88..d8f624fd28 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/offerbook/BisqEasyOfferbookController.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/offerbook/BisqEasyOfferbookController.java @@ -36,6 +36,7 @@ import bisq.common.proto.ProtobufUtils; import bisq.desktop.ServiceProvider; import bisq.desktop.common.observable.FxBindings; +import bisq.desktop.common.threading.UIScheduler; import bisq.desktop.common.threading.UIThread; import bisq.desktop.common.view.InitWithDataController; import bisq.desktop.common.view.Navigation; @@ -121,7 +122,7 @@ public void initWithData(InitData initData) { BisqEasyOfferbookMessage chatMessage = initData.getChatMessage(); bisqEasyOfferbookChannelService.findChannel(chatMessage.getChannelId()).ifPresent(channel -> { maybeUpdateSelectedChannel(channel); - chatMessageContainerController.highlightOfferChatMessage(initData.getChatMessage()); + UIScheduler.run(() -> chatMessageContainerController.highlightOfferChatMessage(initData.getChatMessage())).after(110); }); } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/profile_card/offers/ProfileCardOffersView.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/profile_card/offers/ProfileCardOffersView.java index 7b96a94df4..a6690e7d2c 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/profile_card/offers/ProfileCardOffersView.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/profile_card/offers/ProfileCardOffersView.java @@ -37,13 +37,10 @@ import javafx.scene.control.Label; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; -import javafx.scene.control.TableRow; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.util.Callback; import lombok.extern.slf4j.Slf4j; -import org.fxmisc.easybind.EasyBind; -import org.fxmisc.easybind.Subscription; import java.util.Comparator; @@ -232,7 +229,6 @@ TableCell> getGotToOfferCellFactory() { return column -> new TableCell<>() { private final BisqMenuItem goToOfferButton = new BisqMenuItem( Res.get("user.profileCard.offers.table.columns.goToOffer.button")); - private Subscription selectedPin, hoverPin; { goToOfferButton.setStyle("-fx-text-fill: -fx-mid-text-color;"); @@ -244,13 +240,6 @@ protected void updateItem(OfferbookListItem item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { - TableRow tableRow = getTableRow(); - if (tableRow != null) { - selectedPin = EasyBind.subscribe(tableRow.selectedProperty(), isSelected -> - goToOfferButton.setVisible(isSelected || tableRow.isHover())); - hoverPin = EasyBind.subscribe(tableRow.hoverProperty(), isHover -> - goToOfferButton.setVisible(isHover || tableRow.isSelected())); - } goToOfferButton.setOnAction(e -> OverlayController.hide(() -> Navigation.navigateTo(NavigationTarget.BISQ_EASY_OFFERBOOK, @@ -260,13 +249,6 @@ protected void updateItem(OfferbookListItem item, boolean empty) { goToOfferButton.setOnMouseExited(e -> goToOfferButton.setStyle("-fx-text-fill: -fx-mid-text-color;")); setGraphic(goToOfferButton); } else { - if (selectedPin != null) { - selectedPin.unsubscribe(); - } - if (hoverPin != null) { - hoverPin.unsubscribe(); - } - goToOfferButton.setVisible(false); goToOfferButton.setOnAction(null); goToOfferButton.setOnMouseEntered(null); goToOfferButton.setOnMouseClicked(null);