IDEA-185543 do not ignore a footer height if popup is not shown yet

This commit is contained in:
Sergey Malenkov
2018-03-13 12:16:25 +03:00
parent 9bbbbc6eab
commit b4bee1de63
@@ -1592,20 +1592,18 @@ public class AbstractPopup implements JBPopup {
private void setSize(Dimension size, boolean adjustByContent) {
if (isBusy()) return;
Dimension toSet = size;
Dimension toSet = new Dimension(size);
if (adjustByContent) toSet.height += getAdComponentHeight();
if (myPopup == null) {
myForcedSize = toSet;
}
else {
if (adjustByContent) {
toSet.height += getAdComponentHeight();
}
updateMaskAndAlpha(setSize(myContent, toSet));
}
}
private int getAdComponentHeight() {
return myAdComponent != null && myAdComponent.isShowing() ? myAdComponent.getPreferredSize().height + JBUI.scale(1) : 0;
return myAdComponent != null ? myAdComponent.getPreferredSize().height + JBUI.scale(1) : 0;
}
@Override