fix right stripes

This commit is contained in:
Konstantin Bulenkov
2012-04-02 16:41:42 +02:00
parent 6092d88b7d
commit ec4e0dc63b
@@ -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;