IDEA-147259 "Find Usages" popup is 2 pixels too small, showing unnecessary scrollbar
authorSergey Ignatov <sergey.ignatov@jetbrains.com>
Tue, 3 Nov 2015 12:25:24 +0000 (15:25 +0300)
committerSergey Ignatov <sergey.ignatov@jetbrains.com>
Tue, 3 Nov 2015 12:26:34 +0000 (15:26 +0300)
platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java
platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java

index 7860445f9ccfe68d4a95ae592f86930766b95c5f..06a7f3fbb140efc737f27dfa7580f640024c858a 100644 (file)
@@ -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);
index eb2396f873d478e7265b52abd6157dd5e36d6973..fee50ce87faba9bbfef3909f421aba1747b446bd 100644 (file)
@@ -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) {