diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/PeerTextMessageBox.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/PeerTextMessageBox.java index 53a5b67bfc..31da9bb33b 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/PeerTextMessageBox.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/message_container/list/message_box/PeerTextMessageBox.java @@ -69,8 +69,10 @@ protected void setUpReactions() { copyIcon = getIconWithToolTip(AwesomeIcon.COPY, Res.get("action.copyToClipboard")); // More options dropdown menu - ignoreUserMenuItem = new DropdownMenuItem(Res.get("chat.message.contextMenu.ignoreUser")); - reportUserMenuItem = new DropdownMenuItem(Res.get("chat.message.contextMenu.reportUser")); + ignoreUserMenuItem = new DropdownMenuItem("ignore-grey", "ignore-white", + Res.get("chat.message.contextMenu.ignoreUser")); + reportUserMenuItem = new DropdownMenuItem("report-grey", "report-white", + Res.get("chat.message.contextMenu.reportUser")); moreOptionsMenu = new DropdownMenu("ellipsis-h-grey", "ellipsis-h-white", true); moreOptionsMenu.setTooltip(Res.get("chat.message.moreOptions")); moreOptionsMenu.addMenuItems(ignoreUserMenuItem, reportUserMenuItem); diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/sidebar/UserProfileSidebar.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/sidebar/UserProfileSidebar.java index a6ac012695..59bf62ddb9 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/sidebar/UserProfileSidebar.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/chat/sidebar/UserProfileSidebar.java @@ -220,7 +220,7 @@ public static class View extends bisq.desktop.common.view.View botIdTriple = getInfoBox(Res.get("chat.sideBar.userProfile.nym")); - VBox botIdBox = botIdTriple.getThird(); - botIdCopyButton = createAndGetCopyButton(); - botId = botIdTriple.getSecond(); - botId.setGraphic(botIdCopyButton); - - Triple userIdTriple = getInfoBox(Res.get("chat.sideBar.userProfile.id")); - VBox userIdBox = userIdTriple.getThird(); - userIdCopyButton = createAndGetCopyButton(); - userId = userIdTriple.getSecond(); - userId.setGraphic(userIdCopyButton); - - Triple addressByTransportTriple = getInfoBox(Res.get("chat.sideBar.userProfile.transportAddress")); - VBox addressByTransportBox = addressByTransportTriple.getThird(); - addressByTransportCopyButton = createAndGetCopyButton(); - addressByTransport = addressByTransportTriple.getSecond(); - addressByTransport.setGraphic(addressByTransportCopyButton); + Triple botIdTriple = getInfoBoxWithCopyButton(Res.get("chat.sideBar.userProfile.nym")); + botIdBox = botIdTriple.getThird(); + botIdCopyButton = botIdTriple.getSecond(); + botId = botIdTriple.getFirst(); + + Triple userIdTriple = getInfoBoxWithCopyButton(Res.get("chat.sideBar.userProfile.id")); + userIdBox = userIdTriple.getThird(); + userIdCopyButton = userIdTriple.getSecond(); + userId = userIdTriple.getFirst(); + + Triple addressByTransportTriple = getInfoBoxWithCopyButton(Res.get("chat.sideBar.userProfile.transportAddress")); + addressByTransportBox = addressByTransportTriple.getThird(); + addressByTransportCopyButton = addressByTransportTriple.getSecond(); + addressByTransport = addressByTransportTriple.getFirst(); Triple totalReputationScoreTriple = getInfoBox(Res.get("chat.sideBar.userProfile.totalReputationScore")); VBox totalReputationScoreBox = totalReputationScoreTriple.getThird(); @@ -367,14 +364,14 @@ protected void onViewAttached() { } }); - botId.setOnMouseEntered(e -> botIdCopyButton.setVisible(true)); - botId.setOnMouseExited(e -> botIdCopyButton.setVisible(false)); + botIdBox.setOnMouseEntered(e -> botIdCopyButton.setVisible(true)); + botIdBox.setOnMouseExited(e -> botIdCopyButton.setVisible(false)); botIdCopyButton.setOnMouseClicked(e -> ClipboardUtil.copyToClipboard(model.getUserProfile().getNym())); - userId.setOnMouseEntered(e -> userIdCopyButton.setVisible(true)); - userId.setOnMouseExited(e -> userIdCopyButton.setVisible(false)); + userIdBox.setOnMouseEntered(e -> userIdCopyButton.setVisible(true)); + userIdBox.setOnMouseExited(e -> userIdCopyButton.setVisible(false)); userIdCopyButton.setOnMouseClicked(e -> ClipboardUtil.copyToClipboard(model.getUserProfile().getId())); - addressByTransport.setOnMouseEntered(e -> addressByTransportCopyButton.setVisible(true)); - addressByTransport.setOnMouseExited(e -> addressByTransportCopyButton.setVisible(false)); + addressByTransportBox.setOnMouseEntered(e -> addressByTransportCopyButton.setVisible(true)); + addressByTransportBox.setOnMouseExited(e -> addressByTransportCopyButton.setVisible(false)); addressByTransportCopyButton.setOnMouseClicked(e -> ClipboardUtil.copyToClipboard(model.getUserProfile().getAddressByTransportDisplayString())); @@ -411,14 +408,14 @@ protected void onViewDetached() { catHashNodeSubscription.unsubscribe(); - botId.setOnMouseEntered(null); - botId.setOnMouseExited(null); + botIdBox.setOnMouseEntered(null); + botIdBox.setOnMouseExited(null); botIdCopyButton.setOnMouseClicked(null); - userId.setOnMouseEntered(null); - userId.setOnMouseExited(null); + userIdBox.setOnMouseEntered(null); + userIdBox.setOnMouseExited(null); userIdCopyButton.setOnMouseClicked(null); - addressByTransport.setOnMouseEntered(null); - addressByTransport.setOnMouseExited(null); + addressByTransportBox.setOnMouseEntered(null); + addressByTransportBox.setOnMouseExited(null); addressByTransportCopyButton.setOnMouseClicked(null); privateMsg.setOnAction(null); @@ -432,19 +429,35 @@ protected void onViewDetached() { private static Triple getInfoBox(String title) { Label headline = new Label(title.toUpperCase()); headline.getStyleClass().add("chat-side-bar-user-profile-small-headline"); + Label value = new Label(); value.setWrapText(true); value.getStyleClass().add("chat-side-bar-user-profile-small-value"); - value.setContentDisplay(ContentDisplay.RIGHT); + VBox vBox = new VBox(2.5, headline, value); return new Triple<>(headline, value, vBox); } - private static BisqIconButton createAndGetCopyButton() { + private static Triple getInfoBoxWithCopyButton(String title) { + Label headline = new Label(title.toUpperCase()); + headline.getStyleClass().add("chat-side-bar-user-profile-small-headline"); + + Label value = new Label(); + value.setWrapText(true); + value.getStyleClass().add("chat-side-bar-user-profile-small-value"); + value.setContentDisplay(ContentDisplay.RIGHT); + BisqIconButton copyButton = new BisqIconButton(); copyButton.setIcon(AwesomeIcon.COPY); copyButton.setVisible(false); - return copyButton; + copyButton.setMinWidth(30); + copyButton.setAlignment(Pos.BOTTOM_RIGHT); + HBox.setMargin(copyButton, new Insets(0, 0, 5, 0)); + + HBox hBox = new HBox(value, Spacer.fillHBox(), copyButton); + hBox.setAlignment(Pos.BOTTOM_LEFT); + VBox vBox = new VBox(2.5, headline, hBox); + return new Triple<>(value, copyButton, vBox); } } }