mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
parent
4172cc72df
commit
f2f5a6fd24
@ -42,6 +42,7 @@ import haveno.desktop.Navigation;
|
||||
import haveno.desktop.components.AutoTooltipButton;
|
||||
import haveno.desktop.components.BusyAnimation;
|
||||
import haveno.desktop.main.overlays.Overlay;
|
||||
import haveno.desktop.util.CssTheme;
|
||||
import haveno.desktop.util.DisplayUtils;
|
||||
import static haveno.desktop.util.FormBuilder.addButtonAfterGroup;
|
||||
import static haveno.desktop.util.FormBuilder.addButtonBusyAnimationLabelAfterGroup;
|
||||
@ -54,6 +55,8 @@ import haveno.desktop.util.Layout;
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.geometry.HPos;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Button;
|
||||
@ -312,8 +315,23 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
if (showExtraInfo) {
|
||||
TextArea textArea = addConfirmationLabelTextArea(gridPane, ++rowIndex, Res.get("payment.shared.extraInfo"), "", 0).second;
|
||||
textArea.setText(offer.getExtraInfo());
|
||||
textArea.setMinHeight(33);
|
||||
textArea.setMaxHeight(textArea.getMinHeight());
|
||||
textArea.setMaxHeight(200);
|
||||
textArea.sceneProperty().addListener((o, oldScene, newScene) -> {
|
||||
if (newScene != null) {
|
||||
// avoid javafx css warning
|
||||
CssTheme.loadSceneStyles(newScene, CssTheme.CSS_THEME_LIGHT, false);
|
||||
textArea.applyCss();
|
||||
var text = textArea.lookup(".text");
|
||||
|
||||
textArea.prefHeightProperty().bind(Bindings.createDoubleBinding(() -> {
|
||||
return textArea.getFont().getSize() + text.getBoundsInLocal().getHeight();
|
||||
}, text.boundsInLocalProperty()));
|
||||
|
||||
text.boundsInLocalProperty().addListener((observableBoundsAfter, boundsBefore, boundsAfter) -> {
|
||||
Platform.runLater(() -> textArea.requestLayout());
|
||||
});
|
||||
}
|
||||
});
|
||||
textArea.setEditable(false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user