diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java index 17c37d822fe2..b65a147fa0ef 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java @@ -76,7 +76,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private static final int FREE_PAINTERS_AREA_WIDTH = 5; private static final int GAP_BETWEEN_ICONS = 3; private static final TooltipGroup GUTTER_TOOLTIP_GROUP = new TooltipGroup("GUTTER_TOOLTIP_GROUP", 0); - private static final Color COLOR_F0F0 = new Color(0xF0F0F0); public static final TIntFunction ID = new TIntFunction() { @Override public int execute(int value) { @@ -96,7 +95,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private TIntArrayList myTextAnnotationGutterSizes = new TIntArrayList(); private ArrayList myTextAnnotationGutters = new ArrayList(); private final Map myProviderToListener = new HashMap(); - private static final int GAP_BETWEEN_ANNOTATIONS = 6; + private static final int GAP_BETWEEN_ANNOTATIONS = 5; private Color myBackgroundColor = null; private String myLastGutterToolTip = null; private int myLastPreferredHeight = -1; @@ -227,7 +226,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private void paintEditorBackgrounds(Graphics g, Rectangle clip, int firstVisibleOffset, int lastVisibleOffset) { Color defaultBackgroundColor = myEditor.getBackgroundColor(); - int startX = getWhitespaceSeparatorOffset() + 1; + int startX = getWhitespaceSeparatorOffset() + (isFoldingOutlineShown() ? 1 : 0); IterationState state = new IterationState(myEditor, firstVisibleOffset, lastVisibleOffset, false, true); while (!state.atEnd()) { VisualPosition visualStart = myEditor.offsetToVisualPosition(state.getStartOffset()); @@ -329,19 +328,12 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse x += myTextAnnotationGutterSizes.get(i); } - - if (!myEditor.isInDistractionFreeMode()) { - UIUtil.drawVDottedLine((Graphics2D)g, getAnnotationsAreaOffset() + w - 1, clip.y, clip.y + clip.height, null, getOutlineColor(false)); - } } private void paintFoldingTree(Graphics g, Rectangle clip, int firstVisibleOffset, int lastVisibleOffset) { if (isFoldingOutlineShown()) { doPaintFoldingTree((Graphics2D)g, clip, firstVisibleOffset, lastVisibleOffset); } - else { - UIUtil.drawVDottedLine((Graphics2D)g, clip.x + clip.width - 1, clip.y, clip.y + clip.height, null, getOutlineColor(false)); - } } private void paintLineMarkers(Graphics g, Rectangle clip, int firstVisibleOffset, int lastVisibleOffset) { @@ -378,8 +370,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private void paintLineNumbers(Graphics g, Rectangle clip) { if (isLineNumbersShown()) { - int x = getLineNumberAreaOffset() + getLineNumberAreaWidth() - 2; - UIUtil.drawVDottedLine((Graphics2D)g, x, clip.y, clip.y + clip.height, null, getOutlineColor(false)); doPaintLineNumbers(g, clip); } } @@ -396,7 +386,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse EditorColorsScheme colorsScheme = myEditor.getColorsScheme(); boolean distractionMode = myEditor.isInDistractionFreeMode(); Color color = distractionMode ? colorsScheme.getDefaultBackground() : colorsScheme.getColor(EditorColors.GUTTER_BACKGROUND); - myBackgroundColor = color == null ? COLOR_F0F0 : color; + myBackgroundColor = color == null ? EditorColors.GUTTER_BACKGROUND.getDefaultColor() : color; } return myBackgroundColor; } @@ -648,9 +638,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse } }); - myLineMarkerAreaWidth = myIconsAreaWidth + FREE_PAINTERS_AREA_WIDTH + - // if folding outline is shown, there will be enough place for change markers, otherwise add place for it. - (isFoldingOutlineShown() ? 0 : getFoldingAnchorWidth() / 2); + myLineMarkerAreaWidth = myIconsAreaWidth + FREE_PAINTERS_AREA_WIDTH; } private void paintGutterRenderers(final Graphics g, int firstVisibleOffset, int lastVisibleOffset) { @@ -739,7 +727,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse int height = endY - startY; int w = FREE_PAINTERS_AREA_WIDTH; - int x = getLineMarkerAreaOffset() + myIconsAreaWidth; + int x = getLineMarkerAreaOffset() + myIconsAreaWidth - 1; return new Rectangle(x, startY, w, height); } @@ -770,7 +758,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse final int leftSize = x - getLineMarkerAreaOffset(); - x = getLineMarkerAreaOffset() + myIconsAreaWidth; + x = getLineMarkerAreaOffset() + myIconsAreaWidth - 2; // because of 2px LineMarkerRenderers for (GutterMark r : row) { if (((GutterIconRenderer)r).getAlignment() == GutterIconRenderer.Alignment.RIGHT) { Icon icon = r.getIcon(); @@ -780,7 +768,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse } } - int rightSize = myIconsAreaWidth + getLineMarkerAreaOffset() - x; + int rightSize = myIconsAreaWidth + getLineMarkerAreaOffset() - x + 1; if (middleCount > 0) { middleSize -= GAP_BETWEEN_ICONS; @@ -845,7 +833,9 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private void paintFoldingLines(final Graphics2D g, final Rectangle clip) { if (!isFoldingOutlineShown()) return; - UIUtil.drawVDottedLine(g, getWhitespaceSeparatorOffset(), clip.y, clip.y + clip.height, null, getOutlineColor(false)); + g.setColor(getOutlineColor(false)); + int x = getWhitespaceSeparatorOffset(); + UIUtil.drawLine(g, x, clip.y, x, clip.y + clip.height); final int anchorX = getFoldingAreaOffset(); final int width = getFoldingAnchorWidth(); @@ -981,14 +971,11 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse } public int getFoldingAreaOffset() { - return getLineMarkerAreaOffset() + - getLineMarkerAreaWidth(); + return getLineMarkerAreaOffset() + getLineMarkerAreaWidth(); } public int getFoldingAreaWidth() { - return isFoldingOutlineShown() - ? getFoldingAnchorWidth() + 2 - : 0; + return getFoldingAnchorWidth() + (isFoldingOutlineShown() ? 2 : 0); } @Override @@ -1347,7 +1334,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse } @Override - public void actionPerformed(AnActionEvent e) { + public void actionPerformed(@NotNull AnActionEvent e) { closeAllAnnotations(); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 5179512af245..484191e67b07 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -303,7 +303,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi private final TIntFunction myLineNumberAreaWidthFunction = new TIntFunction() { @Override public int execute(int lineNumber) { - return getFontMetrics(Font.PLAIN).stringWidth(Integer.toString(lineNumber + 1)) + 6; + return getFontMetrics(Font.PLAIN).stringWidth(Integer.toString(lineNumber + 1)) + 5; } }; @@ -6771,10 +6771,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi g.setColor(ButtonlessScrollBarUI.getTrackBackground()); g.fillRect(0, 0, width, height); - int shortner = 0; - if (myGutterComponent.isFoldingOutlineShown()) { - shortner = myGutterComponent.getFoldingAreaWidth() / 2; - } + int shortner = myGutterComponent.getFoldingAreaWidth() / 2; g.setColor(myGutterComponent.getBackground()); g.fillRect(0, 0, width - shortner, height); diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java index d8a704d891bf..87668ba25ea0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java @@ -36,7 +36,6 @@ import com.intellij.openapi.util.Pair; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.FocusWatcher; import com.intellij.ui.PrevNextActionsDescriptor; -import com.intellij.ui.SideBorder; import com.intellij.ui.TabbedPaneWrapper; import com.intellij.ui.tabs.UiDecorator; import com.intellij.util.SmartList; @@ -351,7 +350,7 @@ public abstract class EditorComposite implements Disposable { if (remove) { container.remove(component.getParent()); } else { - container.add(new TopBottomComponentWrapper(component, top)); + container.add(new TopBottomComponentWrapper(component)); } container.revalidate(); } @@ -474,19 +473,10 @@ public abstract class EditorComposite implements Disposable { private static class TopBottomComponentWrapper extends JPanel { private final JComponent myWrappee; - public TopBottomComponentWrapper(JComponent component, boolean top) { + public TopBottomComponentWrapper(JComponent component) { super(new BorderLayout()); myWrappee = component; setOpaque(false); - - setBorder(new SideBorder(null, top ? SideBorder.BOTTOM : SideBorder.TOP, true) { - @Override - public Color getLineColor() { - Color result = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.TEARLINE_COLOR); - return result == null ? Color.black : result; - } - }); - add(component); } diff --git a/platform/platform-resources/src/DefaultColorSchemesManager.xml b/platform/platform-resources/src/DefaultColorSchemesManager.xml index 42ab4dcb3abc..ad7511a69f82 100644 --- a/platform/platform-resources/src/DefaultColorSchemesManager.xml +++ b/platform/platform-resources/src/DefaultColorSchemesManager.xml @@ -18,10 +18,10 @@