Skip to content

Ghidra is a software reverse engineering (SRE) framework

Tweaks to SplashScreen

ghidragon66421c88f9dc
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/framework/SplashScreen.java b/Ghidra/Framework/Docking/src/main/java/docking/framework/SplashScreen.java
index 01fb151859..f7967d623a 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/framework/SplashScreen.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/framework/SplashScreen.java
@@ -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();
}
+
}