IDEA-95274, IDEA-94810 VCS annotations under darcula

(cherry-picked from f472aec)
This commit is contained in:
Konstantin Bulenkov
2012-11-30 13:57:43 +01:00
parent a79574919a
commit 4f74762d08
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="d6822" />
<option name="ANNOTATIONS_COLOR" value="3e83e7" />
<option name="ANNOTATIONS_COLOR" value="748282" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="323232" />
<option name="CONSOLE_BACKGROUND_KEY" value="333333" />
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
import com.intellij.openapi.vcs.impl.UpToDateLineNumberProviderImpl;
import com.intellij.openapi.vcs.impl.VcsBackgroundableActions;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.ColorUtil;
import com.intellij.util.containers.SortedList;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -330,13 +331,18 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
final Map<String, Color> revNumbers = new HashMap<String, Color>();
final int length = BG_COLORS.length;
final List<VcsFileRevision> fileRevisionList = fileAnnotation.getRevisions();
final boolean darcula = UIUtil.isUnderDarcula();
if (fileRevisionList != null) {
for (VcsFileRevision revision : fileRevisionList) {
final String author = revision.getAuthor();
final String revNumber = revision.getRevisionNumber().asString();
if (author != null && !bgColors.containsKey(author)) {
final int size = bgColors.size();
bgColors.put(author, BG_COLORS[size < length ? size : size % length]);
Color color = BG_COLORS[size < length ? size : size % length];
if (darcula) {
color = ColorUtil.shift(color, 0.2);
}
bgColors.put(author, color);
}
if (revNumber != null && !revNumbers.containsKey(revNumber)) {
revNumbers.put(revNumber, bgColors.get(author));