status bar should have a height at least of an icon, even before any icons appear, to prevent unnecessary blinking (IDEA-114453)

This commit is contained in:
peter
2013-11-06 12:00:28 +01:00
parent 1e0e31ec81
commit aa20e7da83
@@ -52,6 +52,7 @@ import java.util.List;
* User: spLeaner
*/
public class IdeStatusBarImpl extends JComponent implements StatusBarEx {
private static final int MIN_ICON_HEIGHT = 18;
private final InfoAndProgressPanel myInfoAndProgressPanel;
private IdeFrame myFrame;
@@ -176,6 +177,16 @@ public class IdeStatusBarImpl extends JComponent implements StatusBarEx {
this(null);
}
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
if (size == null) return null;
Insets insets = getInsets();
int minHeight = insets.top + insets.bottom + MIN_ICON_HEIGHT;
return new Dimension(size.width, Math.max(size.height, minHeight));
}
@Override
public void addWidget(@NotNull final StatusBarWidget widget) {
addWidget(widget, Position.RIGHT, "__AUTODETECT__");
@@ -839,7 +850,7 @@ public class IdeStatusBarImpl extends JComponent implements StatusBarEx {
@Override
public Dimension getMinimumSize() {
return new Dimension(24, 18);
return new Dimension(24, MIN_ICON_HEIGHT);
}
@Override