fix padding when making offer, fix icon alignment in trades

This commit is contained in:
woodser 2025-05-18 08:54:02 -04:00
parent 809e41892b
commit 59d0d26269
No known key found for this signature in database
GPG key ID: 55A10DD48ADEE5EF
5 changed files with 11 additions and 9 deletions

View file

@ -22,6 +22,7 @@ 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.Layout;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.control.Label;
@ -46,7 +47,7 @@ public class TextFieldWithCopyIcon extends AnchorPane {
public TextFieldWithCopyIcon(String customStyleClass) {
Label copyIcon = new Label();
copyIcon.setLayoutY(3);
copyIcon.setLayoutY(Layout.FLOATING_ICON_Y);
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);

View file

@ -21,6 +21,7 @@ import com.jfoenix.controls.JFXTextField;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import haveno.common.UserThread;
import haveno.desktop.util.Layout;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
@ -53,10 +54,10 @@ public class TextFieldWithIcon extends AnchorPane {
iconLabel = new Label();
iconLabel.setLayoutX(0);
iconLabel.setLayoutY(3);
iconLabel.setLayoutY(Layout.FLOATING_ICON_Y);
dummyTextField.widthProperty().addListener((observable, oldValue, newValue) -> {
iconLabel.setLayoutX(dummyTextField.widthProperty().get() + 20);
iconLabel.setLayoutX(dummyTextField.widthProperty().get() + 20 + Layout.FLOATING_ICON_Y);
});
getChildren().addAll(textField, dummyTextField, iconLabel);

View file

@ -29,6 +29,7 @@ import haveno.core.user.Preferences;
import haveno.core.xmr.wallet.XmrWalletService;
import haveno.desktop.components.indicator.TxConfidenceIndicator;
import haveno.desktop.util.GUIUtil;
import haveno.desktop.util.Layout;
import javafx.beans.value.ChangeListener;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
@ -70,12 +71,12 @@ public class TxIdTextField extends AnchorPane {
txConfidenceIndicator.setProgress(0);
txConfidenceIndicator.setVisible(false);
AnchorPane.setRightAnchor(txConfidenceIndicator, 0.0);
AnchorPane.setTopAnchor(txConfidenceIndicator, 3.0);
AnchorPane.setTopAnchor(txConfidenceIndicator, Layout.FLOATING_ICON_Y);
progressIndicatorTooltip = new Tooltip("-");
txConfidenceIndicator.setTooltip(progressIndicatorTooltip);
copyIcon = new Label();
copyIcon.setLayoutY(3);
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);
@ -89,7 +90,7 @@ public class TxIdTextField extends AnchorPane {
AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK);
blockExplorerIcon.setMinWidth(20);
AnchorPane.setRightAnchor(blockExplorerIcon, 52.0);
AnchorPane.setTopAnchor(blockExplorerIcon, 4.0);
AnchorPane.setTopAnchor(blockExplorerIcon, Layout.FLOATING_ICON_Y);
missingTxWarningIcon = new Label();
missingTxWarningIcon.getStyleClass().addAll("icon", "error-icon");
@ -97,7 +98,7 @@ public class TxIdTextField extends AnchorPane {
missingTxWarningIcon.setTooltip(new Tooltip(Res.get("txIdTextField.missingTx.warning.tooltip")));
missingTxWarningIcon.setMinWidth(20);
AnchorPane.setRightAnchor(missingTxWarningIcon, 52.0);
AnchorPane.setTopAnchor(missingTxWarningIcon, 4.0);
AnchorPane.setTopAnchor(missingTxWarningIcon, Layout.FLOATING_ICON_Y);
missingTxWarningIcon.setVisible(false);
missingTxWarningIcon.setManaged(false);

View file

@ -393,7 +393,6 @@ tree-table-view:focused {
.jfx-text-field:readonly, .hyperlink-with-icon {
-fx-background-color: -bs-color-gray-1;
-fx-padding: 0.333333em 0.333333em 0.333333em 0.333333em;
}
.jfx-text-field:readonly > .input-line {

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 on make/take offer
public static final double FLOATING_ICON_Y = 7; // adjust when .jfx-text-field padding is changed for right icons
}