mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 11:39:29 +00:00
parent
4172cc72df
commit
f2f5a6fd24
1 changed files with 20 additions and 2 deletions
|
@ -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 a new issue