IDEA-147259 "Find Usages" popup is 2 pixels too small, showing unnecessary scrollbar

This commit is contained in:
Sergey Ignatov
2015-11-03 15:26:34 +03:00
parent 5e961e9328
commit f7797140ef
2 changed files with 7 additions and 1 deletions
@@ -1075,7 +1075,8 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
int footer = footerSize.height;
int footerBorder = footer == 0 ? 0 : 1;
rectangle.height += headerSize.height + footer + footerBorder;
Insets insets = ((AbstractPopup)popup).getPopupBorder().getBorderInsets(content);
rectangle.height += headerSize.height + footer + footerBorder + insets.top + insets.bottom;
ScreenUtil.fitToScreen(rectangle);
Dimension newDim = rectangle.getSize();
window.setBounds(rectangle);
@@ -395,6 +395,11 @@ public class AbstractPopup implements JBPopup {
setAdText(s, SwingConstants.LEFT);
}
@NotNull
public PopupBorder getPopupBorder() {
return myPopupBorder;
}
@Override
public void setAdText(@NotNull final String s, int alignment) {
if (myAdComponent == null) {