a bit less intrusive lightbulb in lookups

This commit is contained in:
peter
2012-06-06 10:58:09 +02:00
parent 041e6f9a12
commit a9ae465bfb
@@ -41,7 +41,6 @@ import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.event.*;
import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopup;
@@ -57,7 +56,10 @@ import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.DebugUtil;
import com.intellij.ui.*;
import com.intellij.ui.ExpandableItemsHandler;
import com.intellij.ui.LightweightHint;
import com.intellij.ui.ListScrollingUtil;
import com.intellij.ui.ScreenUtil;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.components.JBList;
import com.intellij.ui.components.JBScrollPane;
@@ -1407,15 +1409,15 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
if (myElementHint != null && getCurrentItem() != null) {
final Rectangle bounds = getCurrentItemBounds();
myElementHint.setSize(myElementHint.getPreferredSize());
myElementHint.setLocation(new Point(bounds.x + bounds.width - myElementHint.getWidth(), bounds.y));
myElementHint.setLocation(new Point(bounds.x + bounds.width - myElementHint.getWidth() + myScrollPane.getVerticalScrollBar().getWidth(), bounds.y));
}
}
}
private class LookupHint extends JLabel {
private final Border INACTIVE_BORDER = BorderFactory.createEmptyBorder(4, 4, 4, 4);
private final Border ACTIVE_BORDER = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK, 1), BorderFactory.createEmptyBorder(3, 3, 3, 3));
private final Border INACTIVE_BORDER = BorderFactory.createEmptyBorder(2, 2, 2, 2);
private final Border ACTIVE_BORDER = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK, 1), BorderFactory.createEmptyBorder(1, 1, 1, 1));
private LookupHint() {
setOpaque(false);
setBorder(INACTIVE_BORDER);