mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-172558 Progress popup is small by default
This commit is contained in:
@@ -25,8 +25,10 @@ import com.intellij.ui.ScreenUtil;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.ui.components.panels.VerticalBox;
|
||||
import com.intellij.ui.components.panels.Wrapper;
|
||||
import com.intellij.ui.popup.AbstractPopup;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IJSwingUtilities;
|
||||
import com.intellij.util.ui.JBDimension;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -150,6 +152,7 @@ public class ProcessPopup {
|
||||
int x = (int)(bounds.getMaxX() - width);
|
||||
int y = (int)(bounds.getMaxY() - height);
|
||||
myPopup = builder.createPopup();
|
||||
myPopup.getContent().putClientProperty(AbstractPopup.FIRST_TIME_SIZE, new JBDimension(400, 0));
|
||||
|
||||
StatusBarEx sb = (StatusBarEx)((IdeFrame)frame).getStatusBar();
|
||||
if (sb.isVisible()) {
|
||||
|
||||
@@ -69,6 +69,11 @@ import static com.intellij.openapi.wm.IdeFocusManager.getGlobalInstance;
|
||||
public class AbstractPopup implements JBPopup {
|
||||
public static final String SHOW_HINTS = "ShowHints";
|
||||
|
||||
// Popup size stored with DimensionService is null first time
|
||||
// In this case you can put Dimension in content client properties to adjust size
|
||||
// Zero or negative values (with/height or both) would be ignored (actual values would be obtained from preferred size)
|
||||
public static final String FIRST_TIME_SIZE = "FirstTimeSize";
|
||||
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.ui.popup.AbstractPopup");
|
||||
|
||||
private static final Object SUPPRESS_MAC_CORNER = new Object();
|
||||
@@ -767,7 +772,16 @@ public class AbstractPopup implements JBPopup {
|
||||
|
||||
Rectangle screen = ScreenUtil.getScreenRectangle(aScreenX, aScreenY);
|
||||
if (myLocateWithinScreen) {
|
||||
Dimension size = sizeToSet != null ? sizeToSet : myContent.getPreferredSize();
|
||||
Dimension preferredSize = myContent.getPreferredSize();
|
||||
Object o = myContent.getClientProperty(FIRST_TIME_SIZE);
|
||||
if (sizeToSet == null && o instanceof Dimension) {
|
||||
int w = ((Dimension)o).width;
|
||||
int h = ((Dimension)o).height;
|
||||
if (w > 0) preferredSize.width = w;
|
||||
if (h > 0) preferredSize.height = h;
|
||||
sizeToSet = preferredSize;
|
||||
}
|
||||
Dimension size = sizeToSet != null ? sizeToSet : preferredSize;
|
||||
if (size.width > screen.width) {
|
||||
size.width = screen.width;
|
||||
sizeToSet = size;
|
||||
|
||||
Reference in New Issue
Block a user