From ec4e0dc63bc3a0ca5d312dd993774d5a9ff98a6a Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 2 Apr 2012 16:39:13 +0200 Subject: [PATCH] fix right stripes --- .../openapi/vcs/ex/LineStatusTrackerDrawing.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java index eb5a165829b7..031d0c4c72da 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTrackerDrawing.java @@ -59,7 +59,7 @@ public class LineStatusTrackerDrawing { } static TextAttributes getAttributesFor(final Range range) { - final Color stripeColor = getDiffColor(range); + final Color stripeColor = getDiffColor(range, false); final TextAttributes textAttributes = new TextAttributes(null, stripeColor, null, EffectType.BOXED, Font.PLAIN); textAttributes.setErrorStripeColor(stripeColor); return textAttributes; @@ -117,7 +117,7 @@ public class LineStatusTrackerDrawing { public static LineMarkerRenderer createRenderer(final Range range, final LineStatusTracker tracker) { return new ActiveGutterRenderer() { public void paint(final Editor editor, final Graphics g, final Rectangle r) { - paintGutterFragment(editor, g, r, getDiffColor(range)); + paintGutterFragment(editor, g, r, getDiffColor(range, true)); } public void doAction(final Editor editor, final MouseEvent e) { @@ -258,15 +258,17 @@ public class LineStatusTrackerDrawing { }); } - private static Color getDiffColor(Range range) { + private static Color getDiffColor(Range range, boolean gutter) { final EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme(); switch (range.getType()) { case Range.INSERTED: - return globalScheme.getColor(EditorColors.ADDED_LINES_COLOR); + return gutter ? globalScheme.getColor(EditorColors.ADDED_LINES_COLOR) + : globalScheme.getAttributes(DiffColors.DIFF_INSERTED).getErrorStripeColor(); case Range.DELETED: - return globalScheme.getAttributes(DiffColors.DIFF_DELETED).getEffectColor(); + return globalScheme.getAttributes(DiffColors.DIFF_DELETED).getErrorStripeColor(); case Range.MODIFIED: - return globalScheme.getColor(EditorColors.MODIFIED_LINES_COLOR); + return gutter ? globalScheme.getColor(EditorColors.MODIFIED_LINES_COLOR) + : globalScheme.getAttributes(DiffColors.DIFF_MODIFIED).getErrorStripeColor(); default: assert false; return null;