Skip to content

Commit

Permalink
Always show 'Go to offer' button and add delay to highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
axpoems committed Dec 4, 2024
1 parent 13c6d6d commit 61faf15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -232,7 +229,6 @@ TableCell<OfferbookListItem, OfferbookListItem>> 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;");
Expand All @@ -244,13 +240,6 @@ protected void updateItem(OfferbookListItem item, boolean empty) {
super.updateItem(item, empty);

if (item != null && !empty) {
TableRow<OfferbookListItem> 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,
Expand All @@ -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);
Expand Down

0 comments on commit 61faf15

Please sign in to comment.