Tweaks to SplashScreen

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

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -23,6 +23,8 @@ import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.CompoundBorder;
import org.apache.commons.lang3.StringUtils;
import docking.*;
import docking.widgets.label.GDLabel;
import generic.application.GenericApplicationLayout;
@ -318,8 +320,20 @@ public class SplashScreen extends JWindow {
updateStatus(status);
}
public static void clearStatus() {
updateSplashScreenStatus(null);
}
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() {
@ -415,4 +429,5 @@ public class SplashScreen extends JWindow {
}
}).start();
}
}