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

Disputes UI improvements #5370

Merged
merged 3 commits into from Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions desktop/src/main/java/bisq/desktop/bisq.css
Expand Up @@ -2003,6 +2003,10 @@ textfield */
-fx-font-size: 0.846em;
}

.dispute-chat-border {
-fx-background-color: -bs-color-blue-5;
}

/********************************************************************************************************************
* *
* DAO *
Expand Down
Expand Up @@ -46,6 +46,8 @@

import javafx.beans.value.ChangeListener;

import lombok.Getter;

public class DisputeChatPopup {
public interface ChatCallback {
void onCloseDisputeFromChatWindow(Dispute dispute);
Expand All @@ -60,6 +62,7 @@ public interface ChatCallback {
private double chatPopupStageYPosition = -1;
private ChangeListener<Number> xPositionListener;
private ChangeListener<Number> yPositionListener;
@Getter private Dispute selectedDispute;

DisputeChatPopup(DisputeManager<? extends DisputeList<Dispute>> disputeManager,
CoinFormatter formatter,
Expand All @@ -78,10 +81,12 @@ public boolean isChatShown() {
public void closeChat() {
if (chatPopupStage != null)
chatPopupStage.close();
selectedDispute = null;
}

public void openChat(Dispute selectedDispute, DisputeSession concreteDisputeSession, String counterpartyName) {
closeChat();
this.selectedDispute = selectedDispute;
selectedDispute.getChatMessages().forEach(m -> m.setWasDisplayed(true));
disputeManager.requestPersistence();

Expand All @@ -96,7 +101,7 @@ public void openChat(Dispute selectedDispute, DisputeSession concreteDisputeSess
AnchorPane.setRightAnchor(chatView, 10d);
AnchorPane.setTopAnchor(chatView, -20d);
AnchorPane.setBottomAnchor(chatView, 10d);
pane.setStyle("-fx-background-color: -bs-color-blue-5");
pane.getStyleClass().add("dispute-chat-border");
Button closeDisputeButton = null;
if (!selectedDispute.isClosed() && !disputeManager.isTrader(selectedDispute)) {
closeDisputeButton = new AutoTooltipButton(Res.get("support.closeTicket"));
Expand Down
Expand Up @@ -1366,6 +1366,8 @@ public void updateItem(final Dispute item, boolean empty) {
setText(newValue ? Res.get("support.closed") : Res.get("support.open"));
if (getTableRow() != null)
getTableRow().setOpacity(newValue && item.getBadgeCountProperty().get() == 0 ? 0.4 : 1);
if (item.isClosed() && item == chatPopup.getSelectedDispute())
chatPopup.closeChat(); // close the chat popup when the associated ticket is closed
};
closedProperty = item.isClosedProperty();
closedProperty.addListener(listener);
Expand Down