add copied tooltip in chat view

This commit is contained in:
woodser 2025-06-01 21:26:22 -04:00
parent 1edc5012f7
commit 229389b0a3
No known key found for this signature in database
GPG key ID: 55A10DD48ADEE5EF
2 changed files with 9 additions and 2 deletions

View file

@ -67,6 +67,7 @@ public class QRCodeWindow extends Overlay<QRCodeWindow> {
addHeadLine();
addMessage();
qrCodeImageView.setOnMouseClicked(event -> openWallet());
GridPane.setRowIndex(qrCodeImageView, ++rowIndex);
GridPane.setColumnSpan(qrCodeImageView, 2);
GridPane.setHalignment(qrCodeImageView, HPos.CENTER);

View file

@ -26,7 +26,7 @@ import haveno.desktop.main.overlays.notifications.Notification;
import haveno.desktop.main.overlays.popups.Popup;
import haveno.desktop.util.DisplayUtils;
import haveno.desktop.util.GUIUtil;
import haveno.desktop.util.Layout;
import haveno.core.locale.Res;
import haveno.core.support.SupportManager;
import haveno.core.support.SupportSession;
@ -305,7 +305,13 @@ public class ChatView extends AnchorPane {
UserThread.execute(() -> {
super.updateItem(message, empty);
if (message != null && !empty) {
copyLabel.setOnMouseClicked(e -> Utilities.copyToClipboard(messageLabel.getText()));
copyLabel.setOnMouseClicked(e -> {
Utilities.copyToClipboard(messageLabel.getText());
Tooltip tp = new Tooltip(Res.get("shared.copiedToClipboard"));
Node node = (Node) e.getSource();
UserThread.runAfter(() -> tp.hide(), 1);
tp.show(node, e.getScreenX() + Layout.PADDING, e.getScreenY() + Layout.PADDING);
});
messageLabel.setOnMouseClicked(event -> {
if (2 > event.getClickCount()) {
return;