From 8355b2dfec03d95d1a94b9c9fa49d630f6263f0e Mon Sep 17 00:00:00 2001 From: axpoems <145597137+axpoems@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:16:04 +0200 Subject: [PATCH] Create independent buttons to delete message and an offer --- .../list/message_box/BubbleMessageBox.java | 1 - .../list/message_box/MyOfferMessageBox.java | 15 +++++++++------ .../list/message_box/MyTextMessageBox.java | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/BubbleMessageBox.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/BubbleMessageBox.java index 992ae469ab..e753dc4be1 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/BubbleMessageBox.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/BubbleMessageBox.java @@ -66,7 +66,6 @@ public abstract class BubbleMessageBox extends MessageBox { protected final UserProfileIcon userProfileIcon = new UserProfileIcon(60); protected final HBox actionsHBox = new HBox(5); protected final VBox quotedMessageVBox, contentVBox; - protected final BisqMenuItem deleteAction = new BisqMenuItem("delete-t-grey", "delete-t-red"); private Subscription reactMenuPin; protected ActiveReactionsDisplayBox activeReactionsDisplayHBox; protected ReactMenuBox reactMenuBox; diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyOfferMessageBox.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyOfferMessageBox.java index 97136179cf..79cf09f7ad 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyOfferMessageBox.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyOfferMessageBox.java @@ -22,6 +22,7 @@ import bisq.chat.bisqeasy.offerbook.BisqEasyOfferbookMessage; import bisq.common.util.StringUtils; import bisq.desktop.components.containers.Spacer; +import bisq.desktop.components.controls.BisqMenuItem; import bisq.desktop.main.content.chat.message_container.list.ChatMessageListItem; import bisq.desktop.main.content.chat.message_container.list.ChatMessagesListController; import bisq.i18n.Res; @@ -38,6 +39,7 @@ public final class MyOfferMessageBox extends BubbleMessageBox { private final Label myOfferTitle; + private BisqMenuItem removeOffer; public MyOfferMessageBox(ChatMessageListItem> item, ListView>> list, @@ -63,7 +65,7 @@ public MyOfferMessageBox(ChatMessageListItem onCopyMessage(String.format("%s\n%s", myOfferTitle.getText(), message.getText()))); - deleteAction.setOnAction(e -> controller.onDeleteMessage(item.getChatMessage())); + removeOffer.setOnAction(e -> controller.onDeleteMessage(item.getChatMessage())); } private Label createAndGetMyOfferTitle() { @@ -111,6 +114,6 @@ private Label createAndGetMyOfferTitle() { @Override public void cleanup() { copyAction.setOnAction(null); - deleteAction.setOnAction(null); + removeOffer.setOnAction(null); } } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyTextMessageBox.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyTextMessageBox.java index 93af30330e..0377efd2dc 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyTextMessageBox.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/MyTextMessageBox.java @@ -43,7 +43,7 @@ public final class MyTextMessageBox extends BubbleMessageBox { private final Subscription shouldShowTryAgainPin, messageDeliveryStatusNodePin; private final BisqMenuItem tryAgainMenuItem = item.getTryAgainMenuItem(); private final HBox deliveryStateHBox = new HBox(); - private BisqMenuItem editAction; + private BisqMenuItem editAction, deleteAction; private BisqTextArea editInputField; private Button saveEditButton, cancelEditButton; private HBox messageStatusHbox, editButtonsHBox; @@ -117,6 +117,7 @@ protected void setUpActions() { editAction = new BisqMenuItem("edit-grey", "edit-white"); editAction.useIconOnly(); editAction.setTooltip(Res.get("action.edit")); + deleteAction = new BisqMenuItem("delete-t-grey", "delete-t-red"); deleteAction.useIconOnly(); deleteAction.setTooltip(Res.get("action.delete")); HBox.setMargin(editAction, ACTION_ITEMS_MARGIN);