mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-193300 New SE size is too large when no results are found
This commit is contained in:
+6
-10
@@ -11,6 +11,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.DimensionService;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.ui.SearchTextField;
|
||||
import com.intellij.util.ui.JBInsets;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -109,7 +110,8 @@ public class SearchEverywhereManagerImpl implements SearchEverywhereManager {
|
||||
}
|
||||
|
||||
Dimension size = mySearchEverywhereUI.getMinimumSize();
|
||||
myBalloon.setMinimumSize(withInsets(size));
|
||||
JBInsets.addTo(size, myBalloon.getContent().getInsets());
|
||||
myBalloon.setMinimumSize(size);
|
||||
|
||||
myProject.putUserData(SEARCH_EVERYWHERE_POPUP, myBalloon);
|
||||
Disposer.register(myBalloon, () -> {
|
||||
@@ -144,14 +146,6 @@ public class SearchEverywhereManagerImpl implements SearchEverywhereManager {
|
||||
}
|
||||
}
|
||||
|
||||
private Dimension withInsets(Dimension size) {
|
||||
Insets insets = myBalloon.getContent().getInsets();
|
||||
return new Dimension(
|
||||
size.width + insets.left + insets.right,
|
||||
size.height + insets.top + insets.bottom
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShown() {
|
||||
return mySearchEverywhereUI != null && myBalloon != null && !myBalloon.isDisposed();
|
||||
@@ -202,10 +196,12 @@ public class SearchEverywhereManagerImpl implements SearchEverywhereManager {
|
||||
|
||||
if (viewType == SearchEverywhereUI.ViewType.SHORT) {
|
||||
myBalloonFullSize = myBalloon.getSize();
|
||||
JBInsets.removeFrom(myBalloonFullSize, myBalloon.getContent().getInsets());
|
||||
myBalloon.pack(false, true);
|
||||
} else {
|
||||
if (myBalloonFullSize == null) {
|
||||
myBalloonFullSize = withInsets(mySearchEverywhereUI.getPreferredSize());
|
||||
myBalloonFullSize = mySearchEverywhereUI.getPreferredSize();
|
||||
JBInsets.addTo(myBalloonFullSize, myBalloon.getContent().getInsets());
|
||||
}
|
||||
myBalloon.setSize(myBalloonFullSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user