Tweaks to SplashScreen

This commit is contained in:
ghidragon 2025-07-30 14:46:33 -04:00
parent dbb9e7feee
commit 66421c88f9

View file

@ -23,6 +23,8 @@ import javax.swing.*;
import javax.swing.border.BevelBorder; import javax.swing.border.BevelBorder;
import javax.swing.border.CompoundBorder; import javax.swing.border.CompoundBorder;
import org.apache.commons.lang3.StringUtils;
import docking.*; import docking.*;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
import generic.application.GenericApplicationLayout; import generic.application.GenericApplicationLayout;
@ -318,8 +320,20 @@ public class SplashScreen extends JWindow {
updateStatus(status); updateStatus(status);
} }
public static void clearStatus() {
updateSplashScreenStatus(null);
}
private static void updateStatus(String status) { private static void updateStatus(String status) {
Swing.runIfSwingOrRunLater(() -> statusLabel.setText(status)); // empty strings causes label to lose its height
String message = StringUtils.isBlank(status) ? " " : status;
Swing.runIfSwingOrRunLater(() -> {
statusLabel.setText(message);
Rectangle bounds = statusLabel.getBounds();
bounds.x = 0;
bounds.y = 0;
statusLabel.paintImmediately(bounds);
});
} }
private JPanel createMainPanel() { private JPanel createMainPanel() {
@ -415,4 +429,5 @@ public class SplashScreen extends JWindow {
} }
}).start(); }).start();
} }
} }