Browse Source

fix truncation of alert content in windows

terminal
Craig Raw 3 years ago
parent
commit
aebc670b62
  1. 5
      src/main/java/com/sparrowwallet/sparrow/AppServices.java

5
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -734,8 +734,9 @@ public class AppServices {
}
String[] lines = content.split("\r\n|\r|\n");
if(lines.length > 3) {
alert.getDialogPane().setPrefHeight(200 + lines.length * 20);
if(lines.length > 3 || org.controlsfx.tools.Platform.getCurrent() == org.controlsfx.tools.Platform.WINDOWS) {
double numLines = Arrays.stream(lines).mapToDouble(line -> Math.ceil(TextUtils.computeTextWidth(Font.getDefault(), line, 0) / 300)).sum();
alert.getDialogPane().setPrefHeight(200 + numLines * 20);
}
moveToActiveWindowScreen(alert);

Loading…
Cancel
Save