Skip to content

Commit

Permalink
Configurable colors for vertical indent lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
shafirov committed Mar 11, 2010
1 parent bc02158 commit 7e3a238
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
import com.intellij.codeInsight.highlighting.BraceMatchingUtil;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.openapi.editor.markup.CustomHighlighterRenderer;
Expand Down Expand Up @@ -98,7 +100,8 @@ public void paint(Editor editor,
Point start = editor.visualPositionToXY(new VisualPosition(startPosition.line + 1, startPosition.column));
final VisualPosition endPosition = editor.offsetToVisualPosition(endOffset);
Point end = editor.visualPositionToXY(new VisualPosition(endPosition.line, endPosition.column));
g.setColor(selected ? new Color(200, 200, 200) : new Color(230, 230, 230));
final EditorColorsScheme scheme = editor.getColorsScheme();
g.setColor(selected ? scheme.getColor(EditorColors.SELECTED_INDENT_GUIDE_COLOR) : scheme.getColor(EditorColors.INDENT_GUIDE_COLOR));
g.drawLine(start.x + 2, start.y, start.x + 2, end.y);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public class GeneralColorsPage implements ColorSettingsPage {
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.caret.row"), EditorColors.CARET_ROW_COLOR, ColorDescriptor.Kind.BACKGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.right.margin"), EditorColors.RIGHT_MARGIN_COLOR, ColorDescriptor.Kind.FOREGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.whitespaces"), EditorColors.WHITESPACES_COLOR, ColorDescriptor.Kind.BACKGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.indent.guide"), EditorColors.INDENT_GUIDE_COLOR, ColorDescriptor.Kind.BACKGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.indent.guide.selected"), EditorColors.SELECTED_INDENT_GUIDE_COLOR, ColorDescriptor.Kind.BACKGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.line.number"), EditorColors.LINE_NUMBERS_COLOR, ColorDescriptor.Kind.FOREGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations"), EditorColors.ANNOTATIONS_COLOR, ColorDescriptor.Kind.FOREGROUND),
new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations.merged"), EditorColors.ANNOTATIONS_MERGED_COLOR, ColorDescriptor.Kind.FOREGROUND),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public interface EditorColors {
ColorKey READONLY_BACKGROUND_COLOR = ColorKey.createColorKey("READONLY_BACKGROUND");
ColorKey READONLY_FRAGMENT_BACKGROUND_COLOR = ColorKey.createColorKey("READONLY_FRAGMENT_BACKGROUND");
ColorKey WHITESPACES_COLOR = ColorKey.createColorKey("WHITESPACES");
ColorKey INDENT_GUIDE_COLOR = ColorKey.createColorKey("INDENT_GUIDE");
ColorKey SELECTED_INDENT_GUIDE_COLOR = ColorKey.createColorKey("SELECTED_INDENT_GUIDE");
ColorKey SELECTION_BACKGROUND_COLOR = ColorKey.createColorKey("SELECTION_BACKGROUND");
ColorKey SELECTION_FOREGROUND_COLOR = ColorKey.createColorKey("SELECTION_FOREGROUND");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ options.general.color.descriptor.caret=Caret
options.general.color.descriptor.caret.row=Caret row
options.general.color.descriptor.right.margin=Right margin
options.general.color.descriptor.whitespaces=Whitespaces
options.general.color.descriptor.indent.guide=Vertical indent guide
options.general.color.descriptor.indent.guide.selected=Selected vertical indent guide
options.general.color.descriptor.line.number=Line number
options.general.color.descriptor.vcs.annotations=VCS annotations
options.general.color.descriptor.vcs.annotations.merged=VCS annotations (merged from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<option name="CARET_ROW_COLOR" value="ffffd7"/>
<option name="METHOD_SEPARATORS_COLOR" value="c0c0c0"/>
<option name="WHITESPACES" value="c5c5c5"/>
<option name="INDENT_GUIDE" value="e6e6e6"/>
<option name="SELECTED_INDENT_GUIDE" value="c8c8c8"/>
<option name="SELECTION_FOREGROUND" value="ffffff"/>
<option name="LINE_NUMBERS_COLOR" value="800000"/>
<option name="ANNOTATIONS_COLOR" value="000080" />
Expand Down

0 comments on commit 7e3a238

Please sign in to comment.