From dcb634d4fc2fb3f967de08c36a82ca0217e3c875 Mon Sep 17 00:00:00 2001 From: Kirill Kirichenko Date: Wed, 13 Mar 2019 16:22:34 +0300 Subject: [PATCH] IDEA-207909 Add keys: search field red error background --- .../openapi/options/newEditor/ConfigurableEditor.java | 5 ++--- .../src/themes/metadata/IntelliJPlatform.themeMetadata.json | 3 +++ platform/util/src/com/intellij/ui/LightColors.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java index fe7c16250f42..8ddedbc66a71 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java @@ -20,7 +20,7 @@ import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.ui.JBColor; +import com.intellij.ui.LightColors; import com.intellij.ui.RelativeFont; import com.intellij.ui.components.labels.LinkLabel; import com.intellij.util.containers.JBIterable; @@ -47,7 +47,6 @@ import static javax.swing.SwingUtilities.isDescendingFrom; * @author Sergey.Malenkov */ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWTEventListener { - private static final JBColor ERROR_BACKGROUND = new JBColor(0xffbfbf, 0x591f1f); private static final String RESET_NAME = "Reset"; private static final String RESET_DESCRIPTION = "Rollback changes for this configuration element"; private final MergingUpdateQueue myQueue = new MergingUpdateQueue("SettingsModification", 1000, false, this, this, this); @@ -95,7 +94,7 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT myErrorLabel.setVisible(false); myErrorLabel.setVerticalTextPosition(SwingConstants.TOP); myErrorLabel.setBorder(BorderFactory.createEmptyBorder(10, 15, 15, 15)); - myErrorLabel.setBackground(ERROR_BACKGROUND); + myErrorLabel.setBackground(LightColors.RED); add(BorderLayout.SOUTH, RelativeFont.HUGE.install(myErrorLabel)); add(BorderLayout.CENTER, myCardPanel); Disposer.register(this, myCardPanel); diff --git a/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json b/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json index a5e29bda0301..51565f79f144 100644 --- a/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json +++ b/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json @@ -519,6 +519,9 @@ { "key": "SearchEverywhere.Tab.selectedForeground" }, + { + "key": "SearchField.errorBackground" + }, { "key": "SearchMatch.endBackground", "description": "The yellow rectangle under the search match text" diff --git a/platform/util/src/com/intellij/ui/LightColors.java b/platform/util/src/com/intellij/ui/LightColors.java index 05b8e7045907..39042d68bfce 100644 --- a/platform/util/src/com/intellij/ui/LightColors.java +++ b/platform/util/src/com/intellij/ui/LightColors.java @@ -16,7 +16,7 @@ package com.intellij.ui; -import java.awt.Color; +import java.awt.*; /** * @author max @@ -25,7 +25,7 @@ public interface LightColors { Color YELLOW = new JBColor(new Color(0xffffcc), new Color(0x525229)); Color GREEN = new JBColor(new Color(0xccffcc), new Color(0x356936)); Color BLUE = new JBColor(new Color(0xccccff), new Color(0x589df6)); - Color RED = new JBColor(new Color(0xffcccc), new Color(0x743A3A)); + Color RED = JBColor.namedColor("SearchField.errorBackground", new JBColor(0xffcccc, 0x743A3A)); Color CYAN = new JBColor(new Color(0xccffff), new Color(100, 138, 138)); Color SLIGHTLY_GREEN = new JBColor(new Color(0xeeffee), new Color(0x515B51));