diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
index dfa532ce3637..baeceb4a43c7 100644
--- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
+++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
@@ -66,4 +66,9 @@ public interface EditorColors {
ColorKey BORDER_LINES_COLOR = ColorKey.createColorKey("BORDER_LINES_COLOR");
TextAttributesKey INJECTED_LANGUAGE_FRAGMENT = TextAttributesKey.createTextAttributesKey("INJECTED_LANGUAGE_FRAGMENT");
+
+ TextAttributesKey BREADCRUMBS_DEFAULT = TextAttributesKey.createTextAttributesKey("BREADCRUMBS_DEFAULT");
+ TextAttributesKey BREADCRUMBS_HOVERED = TextAttributesKey.createTextAttributesKey("BREADCRUMBS_HOVERED");
+ TextAttributesKey BREADCRUMBS_CURRENT = TextAttributesKey.createTextAttributesKey("BREADCRUMBS_CURRENT");
+ TextAttributesKey BREADCRUMBS_INACTIVE = TextAttributesKey.createTextAttributesKey("BREADCRUMBS_INACTIVE");
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
index e6e012e3e099..5b0841759ecf 100644
--- a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
+++ b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java
@@ -97,7 +97,12 @@ public class GeneralColorsPage implements ColorSettingsPage, InspectionColorSett
new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.full.coverage"), CodeInsightColors.LINE_FULL_COVERAGE),
new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.partial.coverage"),
CodeInsightColors.LINE_PARTIAL_COVERAGE),
- new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.none.coverage"), CodeInsightColors.LINE_NONE_COVERAGE)
+ new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.none.coverage"), CodeInsightColors.LINE_NONE_COVERAGE),
+
+ new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.breadcrumbs.default"), EditorColors.BREADCRUMBS_DEFAULT),
+ new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.breadcrumbs.hovered"), EditorColors.BREADCRUMBS_HOVERED),
+ new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.breadcrumbs.current"), EditorColors.BREADCRUMBS_CURRENT),
+ new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.breadcrumbs.inactive"), EditorColors.BREADCRUMBS_INACTIVE)
};
private static final ColorDescriptor[] COLOR_DESCRIPTORS = {
diff --git a/platform/platform-resources-en/src/messages/OptionsBundle.properties b/platform/platform-resources-en/src/messages/OptionsBundle.properties
index c8aae0db91f9..d42b3dd515cb 100644
--- a/platform/platform-resources-en/src/messages/OptionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/OptionsBundle.properties
@@ -153,6 +153,10 @@ options.general.color.descriptor.reference.hyperlink=Hyperlinks//Reference
options.general.color.descriptor.todo.defaults=Code//TODO defaults
options.general.color.descriptor.bookmarks=Editor//Bookmarks
options.general.color.soft.wrap.sign=Text//Soft wrap sign
+options.general.color.descriptor.breadcrumbs.default=Editor//Breadcrumbs//Default
+options.general.color.descriptor.breadcrumbs.hovered=Editor//Breadcrumbs//Hovered
+options.general.color.descriptor.breadcrumbs.current=Editor//Breadcrumbs//Current
+options.general.color.descriptor.breadcrumbs.inactive=Editor//Breadcrumbs//Inactive
options.language.defaults.display.name=Language Defaults
diff --git a/platform/platform-resources/src/DefaultColorSchemesManager.xml b/platform/platform-resources/src/DefaultColorSchemesManager.xml
index 5e9e248ce333..521e291dae00 100644
--- a/platform/platform-resources/src/DefaultColorSchemesManager.xml
+++ b/platform/platform-resources/src/DefaultColorSchemesManager.xml
@@ -58,19 +58,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1049,6 +1036,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1105,19 +1125,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2141,6 +2148,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java
index 1e763e376111..389f55c49162 100644
--- a/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java
+++ b/xml/openapi/src/com/intellij/xml/breadcrumbs/BreadcrumbsComponent.java
@@ -18,8 +18,10 @@ package com.intellij.xml.breadcrumbs;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.editor.colors.ColorKey;
+import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.util.Weighted;
import com.intellij.ui.paint.RectanglePainter;
import com.intellij.util.containers.ContainerUtil;
@@ -40,26 +42,6 @@ import java.util.List;
* @author spleaner
*/
public class BreadcrumbsComponent extends JComponent implements Disposable, Weighted {
- private interface Background {
- ColorKey DEFAULT = ColorKey.createColorKey("BREADCRUMBS_BACKGROUND");
- ColorKey HOVERED = ColorKey.createColorKey("BREADCRUMBS_BACKGROUND_HOVERED");
- ColorKey CURRENT = ColorKey.createColorKey("BREADCRUMBS_BACKGROUND_CURRENT");
- ColorKey INACTIVE = ColorKey.createColorKey("BREADCRUMBS_BACKGROUND_INACTIVE");
- }
-
- private interface TextColor {
- ColorKey DEFAULT = ColorKey.createColorKey("BREADCRUMBS_TEXT_COLOR");
- ColorKey HOVERED = ColorKey.createColorKey("BREADCRUMBS_TEXT_COLOR_HOVERED");
- ColorKey CURRENT = ColorKey.createColorKey("BREADCRUMBS_TEXT_COLOR_CURRENT");
- ColorKey INACTIVE = ColorKey.createColorKey("BREADCRUMBS_TEXT_COLOR_INACTIVE");
- }
-
- private interface BorderColor {
- ColorKey DEFAULT = ColorKey.createColorKey("BREADCRUMBS_BORDER_COLOR");
- ColorKey HOVERED = ColorKey.createColorKey("BREADCRUMBS_BORDER_COLOR_HOVERED");
- ColorKey CURRENT = ColorKey.createColorKey("BREADCRUMBS_BORDER_COLOR_CURRENT");
- ColorKey INACTIVE = ColorKey.createColorKey("BREADCRUMBS_BORDER_COLOR_INACTIVE");
- }
private static final Logger LOG = Logger.getInstance("#com.intellij.xml.breadcrumbs.BreadcrumbsComponent");
private static final Painter DEFAULT_PAINTER = new DefaultPainter(new ButtonSettings());
@@ -622,17 +604,17 @@ public class BreadcrumbsComponent extends JComponent
abstract static class PainterSettings {
@Nullable
Color getBackgroundColor(@NotNull final Crumb c) {
- return getColor(c, Background.DEFAULT, Background.HOVERED, Background.CURRENT, Background.INACTIVE);
+ return getAttributes(c).getBackgroundColor();
}
@Nullable
Color getForegroundColor(@NotNull final Crumb c) {
- return getColor(c, TextColor.DEFAULT, TextColor.HOVERED, TextColor.CURRENT, TextColor.INACTIVE);
+ return getAttributes(c).getForegroundColor();
}
@Nullable
Color getBorderColor(@NotNull final Crumb c) {
- return getColor(c, BorderColor.DEFAULT, BorderColor.HOVERED, BorderColor.CURRENT, BorderColor.INACTIVE);
+ return getAttributes(c).getEffectColor();
}
@Nullable
@@ -640,28 +622,34 @@ public class BreadcrumbsComponent extends JComponent
return null;
}
- static Color getColor(Crumb c, ColorKey main, ColorKey hovered, ColorKey current, ColorKey inactive) {
- return EditorColorsManager.getInstance().getGlobalScheme().getColor(
+ @NotNull
+ static TextAttributesKey getKey(Crumb c) {
+ return
c.isHovered()
- ? hovered
+ ? EditorColors.BREADCRUMBS_HOVERED
: c.isSelected()
- ? current
+ ? EditorColors.BREADCRUMBS_CURRENT
: c.isLight() && !(c instanceof NavigationCrumb)
- ? inactive
- : main);
+ ? EditorColors.BREADCRUMBS_INACTIVE
+ : EditorColors.BREADCRUMBS_DEFAULT;
+ }
+
+ @NotNull
+ static TextAttributes getAttributes(Crumb c) {
+ return EditorColorsManager.getInstance().getGlobalScheme().getAttributes(getKey(c));
}
}
static class ButtonSettings extends PainterSettings {
static Color getBackgroundColor(boolean selected, boolean hovered, boolean light, boolean navigationCrumb) {
- return EditorColorsManager.getInstance().getGlobalScheme().getColor(
+ return EditorColorsManager.getInstance().getGlobalScheme().getAttributes(
hovered
- ? Background.HOVERED
+ ? EditorColors.BREADCRUMBS_HOVERED
: selected
- ? Background.CURRENT
+ ? EditorColors.BREADCRUMBS_CURRENT
: light && !navigationCrumb
- ? Background.INACTIVE
- : Background.DEFAULT);
+ ? EditorColors.BREADCRUMBS_INACTIVE
+ : EditorColors.BREADCRUMBS_DEFAULT).getBackgroundColor();
}
@Override