update all copy icons

This commit is contained in:
woodser 2025-05-28 18:18:46 -04:00
parent 84a540a717
commit b71d156aaf
No known key found for this signature in database
GPG key ID: 55A10DD48ADEE5EF
12 changed files with 117 additions and 89 deletions

View file

@ -78,22 +78,22 @@ public class AddressTextField extends AnchorPane {
AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN);
extWalletIcon.setOnMouseClicked(e -> openWallet());
Label copyIcon = new Label();
copyIcon.setLayoutY(Layout.FLOATING_ICON_Y);
copyIcon.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> {
Label copyLabel = new Label();
copyLabel.setLayoutY(Layout.FLOATING_ICON_Y);
copyLabel.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyLabel, new Tooltip(Res.get("addressTextField.copyToClipboard")));
copyLabel.setGraphic(GUIUtil.getCopyIcon());
copyLabel.setOnMouseClicked(e -> {
if (address.get() != null && address.get().length() > 0)
Utilities.copyToClipboard(address.get());
});
AnchorPane.setRightAnchor(copyIcon, 30.0);
AnchorPane.setRightAnchor(copyLabel, 30.0);
AnchorPane.setRightAnchor(extWalletIcon, 5.0);
AnchorPane.setRightAnchor(textField, 55.0);
AnchorPane.setLeftAnchor(textField, 0.0);
getChildren().addAll(textField, copyIcon, extWalletIcon);
getChildren().addAll(textField, copyLabel, extWalletIcon);
}
private void openWallet() {

View file

@ -23,6 +23,7 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
import haveno.common.util.Utilities;
import haveno.core.locale.Res;
import haveno.core.user.Preferences;
import haveno.desktop.util.GUIUtil;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
@ -38,19 +39,19 @@ public class ExplorerAddressTextField extends AnchorPane {
@Getter
private final TextField textField;
private final Label copyIcon, missingAddressWarningIcon;
private final Label copyLabel, missingAddressWarningIcon;
///////////////////////////////////////////////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////////////////////////////////////////////
public ExplorerAddressTextField() {
copyIcon = new Label();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("explorerAddressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 30.0);
copyLabel = new Label();
copyLabel.setLayoutY(3);
copyLabel.getStyleClass().addAll("icon", "highlight");
copyLabel.setTooltip(new Tooltip(Res.get("explorerAddressTextField.copyToClipboard")));
copyLabel.setGraphic(GUIUtil.getCopyIcon());
AnchorPane.setRightAnchor(copyLabel, 30.0);
Tooltip tooltip = new Tooltip(Res.get("explorerAddressTextField.blockExplorerIcon.tooltip"));
@ -71,27 +72,27 @@ public class ExplorerAddressTextField extends AnchorPane {
AnchorPane.setRightAnchor(textField, 80.0);
AnchorPane.setLeftAnchor(textField, 0.0);
textField.focusTraversableProperty().set(focusTraversableProperty().get());
getChildren().addAll(textField, missingAddressWarningIcon, copyIcon);
getChildren().addAll(textField, missingAddressWarningIcon, copyLabel);
}
public void setup(@Nullable String address) {
if (address == null) {
textField.setText(Res.get("shared.na"));
textField.setId("address-text-field-error");
copyIcon.setVisible(false);
copyIcon.setManaged(false);
copyLabel.setVisible(false);
copyLabel.setManaged(false);
missingAddressWarningIcon.setVisible(true);
missingAddressWarningIcon.setManaged(true);
return;
}
textField.setText(address);
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(address));
copyLabel.setOnMouseClicked(e -> Utilities.copyToClipboard(address));
}
public void cleanup() {
textField.setOnMouseClicked(null);
copyIcon.setOnMouseClicked(null);
copyLabel.setOnMouseClicked(null);
textField.setText("");
}
}

View file

@ -17,9 +17,9 @@
package haveno.desktop.components;
import de.jensd.fx.fontawesome.AwesomeIcon;
import haveno.common.util.Utilities;
import haveno.core.locale.Res;
import haveno.desktop.util.GUIUtil;
import haveno.desktop.util.Layout;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleStringProperty;
@ -30,8 +30,6 @@ import javafx.scene.layout.AnchorPane;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static haveno.desktop.util.FormBuilder.getIcon;
public class FundsTextField extends InfoTextField {
public static final Logger log = LoggerFactory.getLogger(FundsTextField.class);
@ -47,11 +45,12 @@ public class FundsTextField extends InfoTextField {
textField.textProperty().unbind();
textField.textProperty().bind(Bindings.concat(textProperty())); // TODO: removed `, " ", fundsStructure` for haveno to fix "Funds needed: .123 XMR (null)" bug
Label copyIcon = getIcon(AwesomeIcon.COPY);
copyIcon.setLayoutY(Layout.FLOATING_ICON_Y);
copyIcon.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyIcon, new Tooltip(Res.get("shared.copyToClipboard")));
copyIcon.setOnMouseClicked(e -> {
Label copyLabel = new Label();
copyLabel.setLayoutY(Layout.FLOATING_ICON_Y);
copyLabel.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyLabel, new Tooltip(Res.get("shared.copyToClipboard")));
copyLabel.setGraphic(GUIUtil.getCopyIcon());
copyLabel.setOnMouseClicked(e -> {
String text = getText();
if (text != null && text.length() > 0) {
String copyText;
@ -65,11 +64,11 @@ public class FundsTextField extends InfoTextField {
}
});
AnchorPane.setRightAnchor(copyIcon, 30.0);
AnchorPane.setRightAnchor(copyLabel, 30.0);
AnchorPane.setRightAnchor(infoIcon, 62.0);
AnchorPane.setRightAnchor(textField, 55.0);
getChildren().add(copyIcon);
getChildren().add(copyLabel);
}
///////////////////////////////////////////////////////////////////////////////////////////

View file

@ -59,7 +59,7 @@ public class InfoTextField extends AnchorPane {
textField.setId("info-field");
infoIcon = getIcon(AwesomeIcon.INFO_SIGN);
infoIcon.setLayoutY(Layout.FLOATING_ICON_Y);
infoIcon.setLayoutY(Layout.FLOATING_ICON_Y - 2);
infoIcon.getStyleClass().addAll("icon", "info");
AnchorPane.setRightAnchor(infoIcon, 7.0);

View file

@ -18,10 +18,9 @@
package haveno.desktop.components;
import com.jfoenix.controls.JFXTextField;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import haveno.common.util.Utilities;
import haveno.core.locale.Res;
import haveno.desktop.util.GUIUtil;
import haveno.desktop.util.Layout;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
@ -46,13 +45,13 @@ public class TextFieldWithCopyIcon extends AnchorPane {
}
public TextFieldWithCopyIcon(String customStyleClass) {
Label copyIcon = new Label();
copyIcon.setLayoutY(Layout.FLOATING_ICON_Y);
copyIcon.getStyleClass().addAll("icon", "highlight");
if (customStyleClass != null) copyIcon.getStyleClass().add(customStyleClass + "-icon");
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> {
Label copyLabel = new Label();
copyLabel.setLayoutY(Layout.FLOATING_ICON_Y);
copyLabel.getStyleClass().addAll("icon", "highlight");
if (customStyleClass != null) copyLabel.getStyleClass().add(customStyleClass + "-icon");
copyLabel.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
copyLabel.setGraphic(GUIUtil.getCopyIcon());
copyLabel.setOnMouseClicked(e -> {
String text = getText();
if (text != null && text.length() > 0) {
String copyText;
@ -78,15 +77,15 @@ public class TextFieldWithCopyIcon extends AnchorPane {
textField.setEditable(false);
if (customStyleClass != null) textField.getStyleClass().add(customStyleClass);
textField.textProperty().bindBidirectional(text);
AnchorPane.setRightAnchor(copyIcon, 5.0);
AnchorPane.setRightAnchor(copyLabel, 5.0);
AnchorPane.setRightAnchor(textField, 30.0);
AnchorPane.setLeftAnchor(textField, 0.0);
AnchorPane.setTopAnchor(copyIcon, 0.0);
AnchorPane.setBottomAnchor(copyIcon, 0.0);
AnchorPane.setTopAnchor(copyLabel, 0.0);
AnchorPane.setBottomAnchor(copyLabel, 0.0);
AnchorPane.setTopAnchor(textField, 0.0);
AnchorPane.setBottomAnchor(textField, 0.0);
textField.focusTraversableProperty().set(focusTraversableProperty().get());
getChildren().addAll(textField, copyIcon);
getChildren().addAll(textField, copyLabel);
}
public void setPromptText(String value) {

View file

@ -52,7 +52,7 @@ public class TxIdTextField extends AnchorPane {
private final TextField textField;
private final Tooltip progressIndicatorTooltip;
private final TxConfidenceIndicator txConfidenceIndicator;
private final Label copyIcon, blockExplorerIcon, missingTxWarningIcon;
private final Label copyLabel, blockExplorerIcon, missingTxWarningIcon;
private MoneroWalletListener walletListener;
private ChangeListener<Number> tradeListener;
@ -75,12 +75,12 @@ public class TxIdTextField extends AnchorPane {
progressIndicatorTooltip = new Tooltip("-");
txConfidenceIndicator.setTooltip(progressIndicatorTooltip);
copyIcon = new Label();
copyIcon.setLayoutY(Layout.FLOATING_ICON_Y);
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 30.0);
copyLabel = new Label();
copyLabel.setLayoutY(Layout.FLOATING_ICON_Y);
copyLabel.getStyleClass().addAll("icon", "highlight");
copyLabel.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip")));
copyLabel.setGraphic(GUIUtil.getCopyIcon());
AnchorPane.setRightAnchor(copyLabel, 30.0);
Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip"));
@ -109,7 +109,7 @@ public class TxIdTextField extends AnchorPane {
AnchorPane.setRightAnchor(textField, 80.0);
AnchorPane.setLeftAnchor(textField, 0.0);
textField.focusTraversableProperty().set(focusTraversableProperty().get());
getChildren().addAll(textField, missingTxWarningIcon, blockExplorerIcon, copyIcon, txConfidenceIndicator);
getChildren().addAll(textField, missingTxWarningIcon, blockExplorerIcon, copyLabel, txConfidenceIndicator);
}
public void setup(@Nullable String txId) {
@ -132,8 +132,8 @@ public class TxIdTextField extends AnchorPane {
textField.setId("address-text-field-error");
blockExplorerIcon.setVisible(false);
blockExplorerIcon.setManaged(false);
copyIcon.setVisible(false);
copyIcon.setManaged(false);
copyLabel.setVisible(false);
copyLabel.setManaged(false);
txConfidenceIndicator.setVisible(false);
missingTxWarningIcon.setVisible(true);
missingTxWarningIcon.setManaged(true);
@ -159,7 +159,7 @@ public class TxIdTextField extends AnchorPane {
textField.setText(txId);
textField.setOnMouseClicked(mouseEvent -> openBlockExplorer(txId));
blockExplorerIcon.setOnMouseClicked(mouseEvent -> openBlockExplorer(txId));
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(txId));
copyLabel.setOnMouseClicked(e -> Utilities.copyToClipboard(txId));
txConfidenceIndicator.setVisible(true);
// update off main thread
@ -178,7 +178,7 @@ public class TxIdTextField extends AnchorPane {
trade = null;
textField.setOnMouseClicked(null);
blockExplorerIcon.setOnMouseClicked(null);
copyIcon.setOnMouseClicked(null);
copyLabel.setOnMouseClicked(null);
textField.setText("");
}

View file

@ -39,7 +39,7 @@
-fx-text-fill: -bs-color-primary;
}
.highlight, .highlight-static {
.highlight, .highlight-static, .highlight.label .glyph-icon {
-fx-text-fill: -fx-accent;
-fx-fill: -fx-accent;
}
@ -973,6 +973,10 @@ tree-table-view:focused {
-fx-text-fill: -bs-background-color;
}
.copy-icon-disputes.label .glyph-icon {
-fx-fill: -bs-background-color;
}
.copy-icon:hover {
-fx-text-fill: -bs-text-color;
}
@ -2257,6 +2261,13 @@ textfield */
-fx-text-fill: -bs-rd-error-red;
}
.popup-headline-information.label .glyph-icon,
.popup-headline-warning.label .glyph-icon,
.popup-icon-information.label .glyph-icon,
.popup-icon-warning.label .glyph-icon {
-fx-fill: -bs-color-primary;
}
.popup-bg {
-fx-font-size: 1.077em;
-fx-background-color: -bs-color-background-popup-overlay;
@ -2386,10 +2397,18 @@ textfield */
-fx-text-fill: -bs-text-color;
}
.message.label .glyph-icon {
-fx-fill: -bs-text-color;
}
.my-message {
-fx-text-fill: -bs-background-color;
}
.my-message.label .glyph-icon {
-fx-fill: -bs-background-color;
}
.message-header {
-fx-text-fill: -bs-color-gray-3;
-fx-font-size: 0.846em;

View file

@ -19,6 +19,8 @@ package haveno.desktop.main.overlays;
import com.google.common.reflect.TypeToken;
import de.jensd.fx.fontawesome.AwesomeIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView;
import haveno.common.Timer;
import haveno.common.UserThread;
import haveno.common.config.Config;
@ -168,7 +170,7 @@ public abstract class Overlay<T extends Overlay<T>> {
protected boolean showScrollPane = false;
protected TextArea messageTextArea;
protected Label headlineIcon, copyIcon, headLineLabel;
protected Label headlineIcon, copyLabel, headLineLabel;
protected String headLine, message, closeButtonText, actionButtonText,
secondaryActionButtonText, dontShowAgainId, dontShowAgainText,
truncatedMessage;
@ -766,12 +768,13 @@ public abstract class Overlay<T extends Overlay<T>> {
if (headLineLabel != null) {
if (copyIcon != null) {
copyIcon.getStyleClass().add("popup-icon-information");
copyIcon.setManaged(true);
copyIcon.setVisible(true);
FormBuilder.getIconForLabel(AwesomeIcon.COPY, copyIcon, "1.1em");
copyIcon.addEventHandler(MOUSE_CLICKED, mouseEvent -> {
if (copyLabel != null) {
copyLabel.getStyleClass().add("popup-icon-information");
copyLabel.setManaged(true);
copyLabel.setVisible(true);
MaterialDesignIconView copyIcon = new MaterialDesignIconView(MaterialDesignIcon.CONTENT_COPY, "1.2em");
copyLabel.setGraphic(copyIcon);
copyLabel.addEventHandler(MOUSE_CLICKED, mouseEvent -> {
if (message != null) {
Utilities.copyToClipboard(getClipboardText());
Tooltip tp = new Tooltip(Res.get("shared.copiedToClipboard"));
@ -838,15 +841,15 @@ public abstract class Overlay<T extends Overlay<T>> {
headLineLabel.setStyle(headlineStyle);
if (message != null) {
copyIcon = new Label();
copyIcon.setManaged(false);
copyIcon.setVisible(false);
copyIcon.setPadding(new Insets(3));
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
copyLabel = new Label();
copyLabel.setManaged(false);
copyLabel.setVisible(false);
copyLabel.setPadding(new Insets(3));
copyLabel.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
final Pane spacer = new Pane();
HBox.setHgrow(spacer, Priority.ALWAYS);
spacer.setMinSize(Layout.PADDING, 1);
hBox.getChildren().addAll(headlineIcon, headLineLabel, spacer, copyIcon);
hBox.getChildren().addAll(headlineIcon, headLineLabel, spacer, copyLabel);
} else {
hBox.getChildren().addAll(headlineIcon, headLineLabel);
}

View file

@ -418,7 +418,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
// add copy button
Label copyLabel = new Label();
copyLabel.getStyleClass().addAll("icon", "highlight");
copyLabel.getStyleClass().addAll("icon");
copyLabel.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
MaterialDesignIconView copyIcon = new MaterialDesignIconView(MaterialDesignIcon.CONTENT_COPY, "1.2em");
copyIcon.setFill(Color.WHITE);

View file

@ -43,7 +43,8 @@ import com.google.common.io.ByteStreams;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView;
import javafx.stage.FileChooser;
import javafx.scene.Node;
@ -272,7 +273,7 @@ public class ChatView extends AnchorPane {
ImageView arrow = new ImageView();
Label headerLabel = new AutoTooltipLabel();
Label messageLabel = new AutoTooltipLabel();
Label copyIcon = new Label();
Label copyLabel = new Label();
HBox attachmentsBox = new HBox();
AnchorPane messageAnchorPane = new AnchorPane();
Label statusIcon = new Label();
@ -293,10 +294,10 @@ public class ChatView extends AnchorPane {
statusIcon.getStyleClass().add("small-text");
statusInfoLabel.getStyleClass().add("small-text");
statusInfoLabel.setPadding(new Insets(3, 0, 0, 0));
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
copyLabel.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
statusHBox.setSpacing(5);
statusHBox.getChildren().addAll(statusIcon, statusInfoLabel);
messageAnchorPane.getChildren().addAll(bg, arrow, headerLabel, messageLabel, copyIcon, attachmentsBox, statusHBox);
messageAnchorPane.getChildren().addAll(bg, arrow, headerLabel, messageLabel, copyLabel, attachmentsBox, statusHBox);
}
@Override
@ -304,7 +305,7 @@ public class ChatView extends AnchorPane {
UserThread.execute(() -> {
super.updateItem(message, empty);
if (message != null && !empty) {
copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(messageLabel.getText()));
copyLabel.setOnMouseClicked(e -> Utilities.copyToClipboard(messageLabel.getText()));
messageLabel.setOnMouseClicked(event -> {
if (2 > event.getClickCount()) {
return;
@ -320,7 +321,7 @@ public class ChatView extends AnchorPane {
AnchorPane.clearConstraints(headerLabel);
AnchorPane.clearConstraints(arrow);
AnchorPane.clearConstraints(messageLabel);
AnchorPane.clearConstraints(copyIcon);
AnchorPane.clearConstraints(copyLabel);
AnchorPane.clearConstraints(statusHBox);
AnchorPane.clearConstraints(attachmentsBox);
@ -329,7 +330,7 @@ public class ChatView extends AnchorPane {
AnchorPane.setTopAnchor(headerLabel, 0d);
AnchorPane.setBottomAnchor(arrow, bottomBorder + 5d);
AnchorPane.setTopAnchor(messageLabel, 25d);
AnchorPane.setTopAnchor(copyIcon, 25d);
AnchorPane.setTopAnchor(copyLabel, 25d);
AnchorPane.setBottomAnchor(attachmentsBox, bottomBorder + 10);
boolean senderIsTrader = message.isSenderIsTrader();
@ -342,20 +343,20 @@ public class ChatView extends AnchorPane {
headerLabel.getStyleClass().removeAll("message-header", "my-message-header", "success-text",
"highlight-static");
messageLabel.getStyleClass().removeAll("my-message", "message");
copyIcon.getStyleClass().removeAll("my-message", "message");
copyLabel.getStyleClass().removeAll("my-message", "message");
if (message.isSystemMessage()) {
headerLabel.getStyleClass().addAll("message-header", "success-text");
bg.setId("message-bubble-green");
messageLabel.getStyleClass().add("my-message");
copyIcon.getStyleClass().add("my-message");
copyLabel.getStyleClass().add("my-message");
message.addWeakMessageStateListener(() -> UserThread.execute(() -> updateMsgState(message)));
updateMsgState(message);
} else if (isMyMsg) {
headerLabel.getStyleClass().add("my-message-header");
bg.setId("message-bubble-blue");
messageLabel.getStyleClass().add("my-message");
copyIcon.getStyleClass().add("my-message");
copyLabel.getStyleClass().add("my-message");
if (supportSession.isClient())
arrow.setId("bubble_arrow_blue_left");
else
@ -376,7 +377,7 @@ public class ChatView extends AnchorPane {
headerLabel.getStyleClass().add("message-header");
bg.setId("message-bubble-grey");
messageLabel.getStyleClass().add("message");
copyIcon.getStyleClass().add("message");
copyLabel.getStyleClass().add("message");
if (supportSession.isClient())
arrow.setId("bubble_arrow_grey_right");
else
@ -390,7 +391,7 @@ public class ChatView extends AnchorPane {
AnchorPane.setRightAnchor(bg, border);
AnchorPane.setLeftAnchor(messageLabel, padding);
AnchorPane.setRightAnchor(messageLabel, msgLabelPaddingRight);
AnchorPane.setRightAnchor(copyIcon, padding);
AnchorPane.setRightAnchor(copyLabel, padding);
AnchorPane.setLeftAnchor(attachmentsBox, padding);
AnchorPane.setRightAnchor(attachmentsBox, padding);
AnchorPane.setLeftAnchor(statusHBox, padding);
@ -401,7 +402,7 @@ public class ChatView extends AnchorPane {
AnchorPane.setLeftAnchor(arrow, border);
AnchorPane.setLeftAnchor(messageLabel, padding + arrowWidth);
AnchorPane.setRightAnchor(messageLabel, msgLabelPaddingRight);
AnchorPane.setRightAnchor(copyIcon, padding);
AnchorPane.setRightAnchor(copyLabel, padding);
AnchorPane.setLeftAnchor(attachmentsBox, padding + arrowWidth);
AnchorPane.setRightAnchor(attachmentsBox, padding);
AnchorPane.setRightAnchor(statusHBox, padding);
@ -412,7 +413,7 @@ public class ChatView extends AnchorPane {
AnchorPane.setRightAnchor(arrow, border);
AnchorPane.setLeftAnchor(messageLabel, padding);
AnchorPane.setRightAnchor(messageLabel, msgLabelPaddingRight + arrowWidth);
AnchorPane.setRightAnchor(copyIcon, padding + arrowWidth);
AnchorPane.setRightAnchor(copyLabel, padding + arrowWidth);
AnchorPane.setLeftAnchor(attachmentsBox, padding);
AnchorPane.setRightAnchor(attachmentsBox, padding + arrowWidth);
AnchorPane.setLeftAnchor(statusHBox, padding);
@ -455,8 +456,9 @@ public class ChatView extends AnchorPane {
}
// Need to set it here otherwise style is not correct
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY, "16.0");
copyIcon.getStyleClass().addAll("icon", "copy-icon-disputes");
copyLabel.getStyleClass().addAll("icon", "copy-icon-disputes");
MaterialDesignIconView copyIcon = new MaterialDesignIconView(MaterialDesignIcon.CONTENT_COPY, "16.0");
copyLabel.setGraphic(copyIcon);
// TODO There are still some cell rendering issues on updates
setGraphic(messageAnchorPane);
@ -466,7 +468,7 @@ public class ChatView extends AnchorPane {
messageAnchorPane.prefWidthProperty().unbind();
copyIcon.setOnMouseClicked(null);
copyLabel.setOnMouseClicked(null);
messageLabel.setOnMouseClicked(null);
setGraphic(null);
}

View file

@ -28,6 +28,7 @@ import com.googlecode.jcsv.writer.internal.CSVWriterBuilder;
import de.jensd.fx.fontawesome.AwesomeIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView;
import haveno.common.UserThread;
import haveno.common.config.Config;
import haveno.common.file.CorruptedStorageFileHandler;
@ -1275,4 +1276,8 @@ public class GUIUtil {
lockLabel.setStyle(lockLabel.getStyle() + " -fx-text-fill: white;");
return lockLabel;
}
public static MaterialDesignIconView getCopyIcon() {
return new MaterialDesignIconView(MaterialDesignIcon.CONTENT_COPY, "1.35em");
}
}

View file

@ -41,5 +41,5 @@ public class Layout {
public static final double GRID_GAP = 5d;
public static final double LIST_ROW_HEIGHT = 34;
public static final double ROUNDED_ARC = 20;
public static final double FLOATING_ICON_Y = 7; // adjust when .jfx-text-field padding is changed for right icons
public static final double FLOATING_ICON_Y = 9; // adjust when .jfx-text-field padding is changed for right icons
}