From 8c33ba48fcd8a489134e79c0ec196b9c0c43aae5 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 22 Jul 2009 20:17:14 +0400 Subject: [PATCH] - shadow for non-movable and non-resizeable popups - ability to create non-movable popups with title panel from component popup builder --- icons/src/ide/shadow/popup/bottom-left.png | Bin 0 -> 446 bytes icons/src/ide/shadow/popup/bottom-right.png | Bin 0 -> 450 bytes icons/src/ide/shadow/popup/bottom.png | Bin 0 -> 202 bytes icons/src/ide/shadow/popup/left.png | Bin 0 -> 168 bytes icons/src/ide/shadow/popup/right.png | Bin 0 -> 166 bytes icons/src/ide/shadow/popup/top-left.png | Bin 0 -> 328 bytes icons/src/ide/shadow/popup/top-right.png | Bin 0 -> 354 bytes icons/src/ide/shadow/popup/top.png | Bin 0 -> 170 bytes .../intellij/ide/actions/ToolWindowSwitcher.java | 39 +++++++++--- .../openapi/ui/impl/ShadowBorderPainter.java | 60 ++++++++++++++---- .../src/com/intellij/ui/popup/AbstractPopup.java | 68 +++++++++++++++++++-- .../ui/popup/ComponentPopupBuilderImpl.java | 5 +- .../src/com/intellij/ui/popup/WizardPopup.java | 2 +- .../src/misc/registry.properties | 1 + 14 files changed, 141 insertions(+), 34 deletions(-) create mode 100644 icons/src/ide/shadow/popup/bottom-left.png create mode 100644 icons/src/ide/shadow/popup/bottom-right.png create mode 100644 icons/src/ide/shadow/popup/bottom.png create mode 100644 icons/src/ide/shadow/popup/left.png create mode 100644 icons/src/ide/shadow/popup/right.png create mode 100644 icons/src/ide/shadow/popup/top-left.png create mode 100644 icons/src/ide/shadow/popup/top-right.png create mode 100644 icons/src/ide/shadow/popup/top.png diff --git a/icons/src/ide/shadow/popup/bottom-left.png b/icons/src/ide/shadow/popup/bottom-left.png new file mode 100644 index 0000000000000000000000000000000000000000..b3a17e271e82311f5336c1c88f25fec1f4da44b5 GIT binary patch literal 446 zcwXxa@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l6(v z^mSxl*w|O|J8&|PuaN8!2!h)Sz7Yhk-*u zOy}MoZqqmBleYg~7}=ry;~z6nvDo`VJii%B&(^QF;lHAP#s`TX!U_!$7h>2yztUIu z$M^MEyvBUiF3FD-Kg}H&HYRlT-1nIE&ylxz=QPfKZpW&BK<8HJ{C6!r7{7w`MB77C z0fmMOdwb@!B-~4P)4o^GSkJ(Cq$7=4Sg5y0a$-!MzU@DD4h1)zbH~~`{cZr|JX&Nt ek4ic;Ffu4C@ezOgjlmum)(oDmelF{r5}E*B>6Eqr literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/bottom-right.png b/icons/src/ide/shadow/popup/bottom-right.png new file mode 100644 index 0000000000000000000000000000000000000000..351863e41a5873249f12594d41c53e581ad84add GIT binary patch literal 450 zcwXxa@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l6(v z^mSxl*w|O|J8&|PuaN8!kF7ud{bDC{Go&@e;d1oN7JGd!lvf@+Kc4o{?h z$anmA%oJe&u{(qrSOiqrjFN;|I22ax7Eox=F#KR|=GefnXcsplQ%C0^iGTg?f*Kf- z7?a9`_MTue{UATX9q;p0(|#3{ty@V&+ury!yj3#Z{l|YfT|rI{W+Zc zpx%VX=nubG_&;_Ig$a%G8-A!WGXHnt{mEK-mwyF!y|N@18v`SY(FbLd_ z;9ghLc{D)cUvtWZ_>|*751lxW&%*Pk-{rr1cVvkfvjcBkAfb7p gE`pn*fq|Lf=j-Y@pBG=&1%@|+r>mdKI;Vst02(2aF8}}l literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/bottom.png b/icons/src/ide/shadow/popup/bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..a477c8f6cf32bd3bec2ab1b4d2a554fc134d2b63 GIT binary patch literal 202 zcwXxa@N?(olHy`uVBq!ia0vp^j6lrA!3HEtFPV4&Db50q$YKTtZeb8+WSBKa0w~Cm z?&#~tz_78e=6B#^AYUQbBgmJ5p-Pp3p`n?9;pcxK{Ss(|0RzLU1O^7H84L{K`IF+0 zx&hTXc)B=-RNP8RNJ#Kt=TJ~n_{gu&;Bdsffq_X-o`H$OWe-p^P2nK3fP+F4FHnlb l*ny#ugAFAApOJ}&VY(`7;-i1=T0pZHJYD@<);T3K0RW!SE>-{l literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/left.png b/icons/src/ide/shadow/popup/left.png new file mode 100644 index 0000000000000000000000000000000000000000..e148b7cf3d1b29ad8342f52af4b4a76b9c620756 GIT binary patch literal 168 zcwXxa@N?(olHy`uVBq!ia0vp^>_E)O!3HFSxVM}GQk(@Ik;M!Q+`=Ht$S`Y;1W=GA z-O<;Pfnj4`&F{d;K)ynP$h$>tDnm{ Hr-UW|4gMxs literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/right.png b/icons/src/ide/shadow/popup/right.png new file mode 100644 index 0000000000000000000000000000000000000000..6d9482097e994118f0688325da5881411095a7f2 GIT binary patch literal 166 zcwXxa@N?(olHy`uVBq!ia0vp^>_E)O!3HFSxVM}GQk(@Ik;M!Q+`=Ht$S`Y;1W=GA z-O<;Pfnj4`&F{d;K)ynU6iyx?t!PC{xWt~$( F69B~KCEWl3 literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/top-left.png b/icons/src/ide/shadow/popup/top-left.png new file mode 100644 index 0000000000000000000000000000000000000000..c5fa4b0e2ed2bc7faeb04609f4fd98c63846dc66 GIT binary patch literal 328 zcwXxa@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa&H|6fVg?3oVGw3ym^DWND9DoT z=vgk z9DE{p9L*Ti89-`9TIM8u$O39hk^ZlI^me?$zg~Z3hXzIlZx;U320D}Lfj(jIboFyt I=akR{0H9J?bpQYW literal 0 HcwPel00001 diff --git a/icons/src/ide/shadow/popup/top-right.png b/icons/src/ide/shadow/popup/top-right.png new file mode 100644 index 0000000000000000000000000000000000000000..63871ed4672cf7df380d1ad4c3ebd14b6f903d90 GIT binary patch literal 354 zcwXxa@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa&H|6fVg?3oVGw3ym^DWND9DoT z=K^%D#_&NB!&{4i-^P`@G; zrtq&-M6QQ{@rcU-w=j*gwydO6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx`EVsx;TbZ+)7FS0wxXxHHCvr0uBmI%nA(-Eb0yoKnGl9kh@;@8fXp!gQu&X%Q~lo FCID3VCshCd literal 0 HcwPel00001 diff --git a/platform-impl/src/com/intellij/ide/actions/ToolWindowSwitcher.java b/platform-impl/src/com/intellij/ide/actions/ToolWindowSwitcher.java index e5843e2f7c..b1d8a32c0e 100644 --- a/platform-impl/src/com/intellij/ide/actions/ToolWindowSwitcher.java +++ b/platform-impl/src/com/intellij/ide/actions/ToolWindowSwitcher.java @@ -5,8 +5,8 @@ import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.impl.EditorHistoryManager; -import com.intellij.openapi.project.Project; import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.Computable; @@ -30,10 +30,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.*; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; +import java.awt.event.*; import java.awt.image.BufferedImage; import java.io.File; import java.util.*; @@ -60,7 +57,7 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { } } - private class ToolWindowSwitcherPanel extends JPanel implements KeyListener, MouseListener { + private class ToolWindowSwitcherPanel extends JPanel implements KeyListener, MouseListener, MouseMotionListener { final JBPopup myPopup; final Map ids = new HashMap(); final JList toolwindows; @@ -72,7 +69,6 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { final int CTRL_KEY; final int ALT_KEY; - ToolWindowSwitcherPanel(Project project) { super(new BorderLayout(0, 0)); this.project = project; @@ -117,6 +113,7 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { toolwindows.setCellRenderer(new ToolWindowsRenderer(ids)); toolwindows.addKeyListener(this); toolwindows.addMouseListener(this); + toolwindows.addMouseMotionListener(this); toolwindows.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!toolwindows.getSelectionModel().isSelectionEmpty()) { @@ -153,6 +150,7 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { files.setCellRenderer(new VirtualFilesRenderer(project)); files.addKeyListener(this); files.addMouseListener(this); + files.addMouseMotionListener(this); files.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!files.getSelectionModel().isSelectionEmpty()) { @@ -182,7 +180,6 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { } public void valueChanged(final ListSelectionEvent e) { - //noinspection SSBasedInspection SwingUtilities.invokeLater(new Runnable() { public void run() { updatePathLabel(); @@ -220,8 +217,8 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { .setModalContext(false) .setFocusable(true) .setRequestFocus(true) - .setMovable(true) .setTitle("Switcher") + .setMovable(false) .setCancelCallback(new Computable() { public Boolean compute() { SWITCHER = null; @@ -268,6 +265,7 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { } } + public void keyReleased(KeyEvent e) { if (e.getKeyCode() == CTRL_KEY || e.getKeyCode() == KeyEvent.VK_ENTER) { navigate(); @@ -390,13 +388,34 @@ public class ToolWindowSwitcher extends AnAction implements DumbAware { if (jList.getSelectedIndex() == -1 && jList.getAnchorSelectionIndex() != -1) { jList.setSelectedIndex(jList.getAnchorSelectionIndex()); } - if (e.getClickCount() > 1) navigate(); + if (jList.getSelectedIndex() != -1) { + navigate(); + } + } + } + + private boolean mouseMovedFirstTime = true; + public void mouseMoved(MouseEvent e) { + if (mouseMovedFirstTime) { + mouseMovedFirstTime = false; + return; + } + + final Object source = e.getSource(); + if (source instanceof JList) { + JList list = (JList)source; + int index = list.locationToIndex(e.getPoint()); + if (0 <= index && index < list.getModel().getSize()) { + list.setSelectedIndex(index); + } } } + public void mousePressed(MouseEvent e) {} public void mouseReleased(MouseEvent e) {} public void mouseEntered(MouseEvent e) {} public void mouseExited(MouseEvent e) {} + public void mouseDragged(MouseEvent e) {} } private static class VirtualFilesRenderer extends ColoredListCellRenderer { diff --git a/platform-impl/src/com/intellij/openapi/ui/impl/ShadowBorderPainter.java b/platform-impl/src/com/intellij/openapi/ui/impl/ShadowBorderPainter.java index 14355e0410..eca74e3bfe 100644 --- a/platform-impl/src/com/intellij/openapi/ui/impl/ShadowBorderPainter.java +++ b/platform-impl/src/com/intellij/openapi/ui/impl/ShadowBorderPainter.java @@ -8,6 +8,7 @@ import java.awt.image.BufferedImage; /** * @author spleaner + * @author Konstantin Bulenkov */ public class ShadowBorderPainter { private static final Icon TOP = IconLoader.getIcon("/ide/shadow/top.png"); @@ -23,36 +24,69 @@ public class ShadowBorderPainter { public static final int TOP_SIZE = 20; public static final int BOTTOM_SIZE = 49; + private static final Icon POPUP_TOP = IconLoader.getIcon("/ide/shadow/popup/top.png"); + private static final Icon POPUP_TOP_RIGHT = IconLoader.getIcon("/ide/shadow/popup/top-right.png"); + private static final Icon POPUP_RIGHT = IconLoader.getIcon("/ide/shadow/popup/right.png"); + private static final Icon POPUP_BOTTOM_RIGHT = IconLoader.getIcon("/ide/shadow/popup/bottom-right.png"); + private static final Icon POPUP_BOTTOM = IconLoader.getIcon("/ide/shadow/popup/bottom.png"); + private static final Icon POPUP_BOTTOM_LEFT = IconLoader.getIcon("/ide/shadow/popup/bottom-left.png"); + private static final Icon POPUP_LEFT = IconLoader.getIcon("/ide/shadow/popup/left.png"); + private static final Icon POPUP_TOP_LEFT = IconLoader.getIcon("/ide/shadow/popup/top-left.png"); + + public static final int POPUP_SIDE_SIZE = 7; + public static final int POPUP_TOP_SIZE = 4; + public static final int POPUP_BOTTOM_SIZE = 10; + private ShadowBorderPainter() { } - public static BufferedImage createShadow(final JComponent c, final int width, final int height) { + public static BufferedImage createShadow(final JComponent c, final int width, final int height, boolean isPopup) { final GraphicsConfiguration graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getDefaultConfiguration(); - final BufferedImage image = graphicsConfiguration.createCompatibleImage(width, height, Transparency.TRANSLUCENT);; + final BufferedImage image = graphicsConfiguration.createCompatibleImage(width, height, Transparency.TRANSLUCENT); final Graphics2D g = image.createGraphics(); - TOP_LEFT.paintIcon(c, g, 0, 0); - TOP_RIGHT.paintIcon(c, g, width - SIDE_SIZE * 2, 0); + final Icon topLeft = isPopup ? POPUP_TOP_LEFT : TOP_LEFT; + final Icon topRight = isPopup ? POPUP_TOP_RIGHT : TOP_RIGHT; + final Icon bottom = isPopup ? POPUP_BOTTOM : BOTTOM; + final Icon top = isPopup ? POPUP_TOP : TOP; + final Icon bottomRight = isPopup ? POPUP_BOTTOM_RIGHT : BOTTOM_RIGHT; + final Icon bottomLeft = isPopup ? POPUP_BOTTOM_LEFT : BOTTOM_LEFT; + final Icon left = isPopup ? POPUP_LEFT : LEFT; + final Icon right = isPopup ? POPUP_RIGHT : RIGHT; + final int sideSize = isPopup ? POPUP_SIDE_SIZE : SIDE_SIZE; + final int bottomSize = isPopup ? POPUP_BOTTOM_SIZE : BOTTOM_SIZE; + + + topLeft.paintIcon(c, g, 0, 0); + topRight.paintIcon(c, g, width - sideSize * 2, 0); - for (int _x = SIDE_SIZE * 2; _x < width - SIDE_SIZE * 2; _x ++) { - TOP.paintIcon(c, g, _x, 0); + for (int _x = sideSize * 2; _x < width - sideSize * 2; _x ++) { + top.paintIcon(c, g, _x, 0); } - for (int _x = BOTTOM_SIZE * 2; _x < width - BOTTOM_SIZE * 2; _x ++) { - BOTTOM.paintIcon(c, g, _x, height - BOTTOM_SIZE); + for (int _x = bottomSize * 2; _x < width - bottomSize * 2; _x ++) { + bottom.paintIcon(c, g, _x, height - bottomSize); } - for (int _y = SIDE_SIZE * 2; _y < height - BOTTOM_SIZE * 2; _y ++) { - LEFT.paintIcon(c, g, 0, _y); - RIGHT.paintIcon(c, g, width - SIDE_SIZE, _y); + for (int _y = sideSize * 2; _y < height - bottomSize * 2; _y ++) { + left.paintIcon(c, g, 0, _y); + right.paintIcon(c, g, width - sideSize, _y); } - BOTTOM_RIGHT.paintIcon(c, g, width - BOTTOM_SIZE * 2, height - BOTTOM_SIZE * 2); - BOTTOM_LEFT.paintIcon(c, g, 0, height - BOTTOM_SIZE * 2); + bottomRight.paintIcon(c, g, width - bottomSize * 2, height - bottomSize * 2); + bottomLeft.paintIcon(c, g, 0, height - bottomSize * 2); g.dispose(); return image; } + + public static BufferedImage createShadow(final JComponent c, final int width, final int height) { + return createShadow(c, width, height, false); + } + + public static BufferedImage createPopupShadow(final JComponent c, final int width, final int height) { + return createShadow(c, width, height, true); + } } diff --git a/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java index f535739ddb..b979bea89f 100644 --- a/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java +++ b/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java @@ -1,6 +1,7 @@ package com.intellij.ui.popup; import com.intellij.codeInsight.hint.HintUtil; +import com.intellij.ide.ui.UISettings; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.DataConstants; import com.intellij.openapi.actionSystem.DataContext; @@ -12,8 +13,11 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.impl.ShadowBorderPainter; +import static com.intellij.openapi.ui.impl.ShadowBorderPainter.*; import com.intellij.openapi.ui.popup.*; import com.intellij.openapi.util.*; +import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.openapi.wm.WindowManager; import com.intellij.openapi.wm.ex.WindowManagerEx; @@ -30,8 +34,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; +import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.*; +import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -70,6 +76,7 @@ public class AbstractPopup implements JBPopup { protected FocusTrackback myFocusTrackback; private Dimension myMinSize; private ArrayList myUserData; + private boolean myShadowed; private float myAlpha = 0; private float myLastAlpha = 0; @@ -88,6 +95,7 @@ public class AbstractPopup implements JBPopup { protected Component myOwner; protected Component myRequestorComponent; private boolean myHeaderAlwaysFocusable; + private boolean myMovable; private JComponent myHeaderComponent; protected InputEvent myDisposeEvent; @@ -126,6 +134,7 @@ public class AbstractPopup implements JBPopup { final boolean requestFocus, final boolean focusable, final boolean forceHeavyweight, + final boolean movable, final String dimensionServiceKey, final boolean resizable, @Nullable final String caption, @@ -159,6 +168,7 @@ public class AbstractPopup implements JBPopup { myProject = project; myComponent = component; myPopupBorder = PopupBorder.Factory.create(true); + myShadowed = !movable && !resizable && Registry.is("ide.popup.dropShadow"); myContent = createContentPanel(resizable, myPopupBorder, isToDrawMacCorner()); myContent.add(component, BorderLayout.CENTER); @@ -175,6 +185,7 @@ public class AbstractPopup implements JBPopup { myModalContext = modalContext; myFocusOwners = focusOwners; myHeaderAlwaysFocusable = headerAlwaysFocusable; + myMovable = movable; ActiveIcon actualIcon = titleIcon == null ? new ActiveIcon(new EmptyIcon(0)) : titleIcon; @@ -248,7 +259,7 @@ public class AbstractPopup implements JBPopup { @NotNull protected MyContentPanel createContentPanel(final boolean resizable, PopupBorder border, boolean isToDrawMacCorner) { - return new MyContentPanel(resizable, border, isToDrawMacCorner); + return new MyContentPanel(resizable, border, isToDrawMacCorner, myShadowed); } public static boolean isToDrawMacCorner() { @@ -585,7 +596,7 @@ public class AbstractPopup implements JBPopup { glass.addMouseMotionPreprocessor(resizeListener, this); } - if (myCaption != null) { + if (myCaption != null && myMovable) { final MoveComponentListener moveListener = new MoveComponentListener(myCaption) { public void mousePressed(final MouseEvent e) { super.mousePressed(e); @@ -901,23 +912,68 @@ public class AbstractPopup implements JBPopup { public static class MyContentPanel extends JPanel { private final boolean myResizable; private final boolean myDrawMacCorner; + private final boolean myShadowed; - public MyContentPanel(final boolean resizable, PopupBorder border, boolean drawMacCorner) { + public MyContentPanel(final boolean resizable, final PopupBorder border, boolean drawMacCorner) { + this(resizable, border, drawMacCorner, false); + } + + public MyContentPanel(final boolean resizable, final PopupBorder border, boolean drawMacCorner, boolean shadowed) { super(new BorderLayout()); myResizable = resizable; myDrawMacCorner = drawMacCorner; - setBorder(border); + myShadowed = shadowed; + if (isShadowPossible()) { + setOpaque(false); + setBorder(new EmptyBorder(POPUP_TOP_SIZE, POPUP_SIDE_SIZE, POPUP_BOTTOM_SIZE, POPUP_SIDE_SIZE) { + @Override + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { + border.paintBorder(c, g, + x + POPUP_SIDE_SIZE - 1, + y + POPUP_TOP_SIZE - 1, + width - 2 * POPUP_SIDE_SIZE + 2, + height - POPUP_TOP_SIZE - POPUP_BOTTOM_SIZE + 2); + } + }); + } else { + setBorder(border); + } + } + + private boolean isShadowPossible() { + return myShadowed && !SystemInfo.isMac && !UISettings.isRemoteDesktopConnected(); } public void paint(Graphics g) { + if (isShadowPossible()) { + paintShadow(g); + } + super.paint(g); + if (myResizable && myDrawMacCorner) { - g.drawImage(ourMacCorner, getX() + getWidth() - ourMacCorner.getWidth(this), getY() + getHeight() - ourMacCorner.getHeight(this), + g.drawImage(ourMacCorner, + getX() + getWidth() - ourMacCorner.getWidth(this), + getY() + getHeight() - ourMacCorner.getHeight(this), this); } } - } + private void paintShadow(final Graphics g) { + BufferedImage capture = null; + try { + final Point onScreen = getLocationOnScreen(); + capture = new Robot().createScreenCapture( + new Rectangle(onScreen.x, onScreen.y, getWidth() + 2 * POPUP_SIDE_SIZE, getHeight() + POPUP_TOP_SIZE + POPUP_BOTTOM_SIZE)); + final BufferedImage shadow = ShadowBorderPainter.createPopupShadow(this, getWidth(), getHeight()); + ((Graphics2D)capture.getGraphics()).drawImage(shadow, null, null); + } + catch (Exception e) { + e.printStackTrace(); + } + if (capture != null) g.drawImage(capture, 0, 0, null); + } + } public boolean isCancelOnClickOutside() { return myCancelOnClickOutside; diff --git a/platform-impl/src/com/intellij/ui/popup/ComponentPopupBuilderImpl.java b/platform-impl/src/com/intellij/ui/popup/ComponentPopupBuilderImpl.java index 0ffed4852f..bfa7e6de88 100644 --- a/platform-impl/src/com/intellij/ui/popup/ComponentPopupBuilderImpl.java +++ b/platform-impl/src/com/intellij/ui/popup/ComponentPopupBuilderImpl.java @@ -176,15 +176,12 @@ public class ComponentPopupBuilderImpl implements ComponentPopupBuilder { @NotNull public JBPopup createPopup() { final AbstractPopup popup = new AbstractPopup().init(myProject, myComponent, myPrefferedFocusedComponent, myRequestFocus, myFocusable, myForceHeavyweight, - myDimensionServiceKey, myResizable, myMovable ? myTitle != null ? myTitle : "" : null, + myMovable, myDimensionServiceKey, myResizable, myTitle, myCallback, myCancelOnClickOutside, myListeners, myUseDimSevriceForXYLocation, myCommandButton, myCancelButton, myCancelOnMouseOutCallback, myCancelOnWindow, myTitleIcon, myCancelKeyEnabled, myLocateByContent, myPlacewithinScreen, myMinSize, myAlpha, myMaskProvider, myInStack, myModalContext, myFocusOwners, myAd, myHeaderAlwaysFocusable, myKeyboardActions, mySettingsButtons); - if (myProject != null) { - popup.setProject(myProject); - } if (myUserData != null) { popup.setUserData(myUserData); } diff --git a/platform-impl/src/com/intellij/ui/popup/WizardPopup.java b/platform-impl/src/com/intellij/ui/popup/WizardPopup.java index 851655d20f..0cb0153bbc 100644 --- a/platform-impl/src/com/intellij/ui/popup/WizardPopup.java +++ b/platform-impl/src/com/intellij/ui/popup/WizardPopup.java @@ -73,7 +73,7 @@ public abstract class WizardPopup extends AbstractPopup implements ActionListene myScrollPane.setBorder(null); final Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()); - init(project, myScrollPane, getPreferredFocusableComponent(), true, true, true, null, + init(project, myScrollPane, getPreferredFocusableComponent(), true, true, true, true, null, false, aStep.getTitle(), null, true, null, false, null, null, null, false, null, true, false, true, null, 0f, null, true, false, new Component[0], null, true, Collections.>emptyList(), null); diff --git a/platform-resources_eng/src/misc/registry.properties b/platform-resources_eng/src/misc/registry.properties index 58ade9ff92..1c3ef422ae 100644 --- a/platform-resources_eng/src/misc/registry.properties +++ b/platform-resources_eng/src/misc/registry.properties @@ -17,6 +17,7 @@ ide.debugMode.description=Record additonal information to make bug reports more ide.forcedShowTooltip=alt ide.forcedShowTooltip.description=Shortcut for forced show tooltip ide.tree.yeildingUiUpdate=true +ide.popup.dropShadow=true ide.tree.showBusyIndicator=true ide.tree.waitForReadyTimout=250 ide.tree.clearOnHideTime=120000 -- 2.11.4.GIT