diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/AnalyzingBannerDecorator.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/AnalyzingBannerDecorator.kt index 8438f6356ef3..b89599834746 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/AnalyzingBannerDecorator.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/AnalyzingBannerDecorator.kt @@ -53,6 +53,14 @@ internal class AnalyzingBannerDecorator(private val panel: JPanel, onBannerClose panel.remove(banner) } + fun getBannerHeight(): Int { + return banner.preferredSize.height + (analyzingComponent?.preferredSize?.height ?: 0) + JBUI.scale(28) + } + + fun isBannerPresent(): Boolean { + return panel.components.contains(banner) + } + private fun createBanner(revalidatePanel: Runnable): Component { val banner = InlineBanner().apply { setMessage(IndexingBundle.message("progress.indexing.banner.text")) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java index 67d4fdbcfd99..eab8f10a83eb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java @@ -132,6 +132,18 @@ final class ProcessPopup { return new Rectangle(x, y, width, height); } + private void updateHeight(int height) { + if (!myPopupVisible || myContentPanel.getSize().height >= height) { + return; + } + + myContentPanel.setPreferredSize(new Dimension(myContentPanel.getPreferredSize().width, height)); + myContentPanel.revalidate(); + myPopup.pack(false, true); + + myPopup.moveToFitScreen(); + } + public void show(boolean requestFocus) { updateContentUI(); @@ -143,6 +155,9 @@ final class ProcessPopup { myContentPanel.setPreferredSize(popupBounds.getSize()); myPopupVisible = true; myPopup.showInScreenCoordinates(myProgressPanel.getComponent().getRootPane(), popupBounds.getLocation()); + if (myAnalyzingBannerDecorator.isBannerPresent()) { + updateHeight(myAnalyzingBannerDecorator.getBannerHeight()); + } } public boolean isShowing() {