mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-215297 fix: set the correct height to make the banner fully visible when open processes popup
GitOrigin-RevId: 62132f61839d46a3ab53720b4553d14b8bc7bea5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
57c56eb8da
commit
9846403fab
+8
@@ -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"))
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user