From 7cc0e89c20034705f9ee0a872f12c8996e78cd3d Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sun, 20 Jan 2013 15:28:00 +0100 Subject: [PATCH] jbcolor.red --- .../codeInsight/lookup/impl/LookupCellRenderer.java | 9 ++++----- .../ui/components/panels/ValidatingComponent.java | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java index 286bfb6af03c..24cda004f14c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -124,23 +124,22 @@ public class LookupCellRenderer implements ListCellRenderer { myIsSelected = isSelected; final LookupElement item = (LookupElement)value; - final boolean dark = UIUtil.isUnderDarcula(); final Color foreground = getForegroundColor(isSelected); - final Color background = isSelected ? SELECTED_BACKGROUND_COLOR : dark ? BACKGROUND_COLOR_DARK_VARIANT : BACKGROUND_COLOR; + final Color background = isSelected ? SELECTED_BACKGROUND_COLOR : new JBColor(BACKGROUND_COLOR, BACKGROUND_COLOR_DARK_VARIANT); int allowedWidth = list.getWidth() - AFTER_TAIL - AFTER_TYPE - getIconIndent(); final LookupElementPresentation presentation = new RealLookupElementPresentation(isSelected ? getMaxWidth() : allowedWidth, myNormalMetrics, myBoldMetrics, myLookup); if (item.isValid()) { item.renderElement(presentation); } else { - presentation.setItemTextForeground(Color.RED); + presentation.setItemTextForeground(JBColor.RED); presentation.setItemText("Invalid"); } myNameComponent.clear(); myNameComponent.setIcon(augmentIcon(presentation.getIcon(), myEmptyIcon)); myNameComponent.setBackground(background); - allowedWidth -= setItemTextLabel(item, dark ? foreground : isSelected ? SELECTED_FOREGROUND_COLOR : presentation.getItemTextForeground(), isSelected, presentation, allowedWidth); + allowedWidth -= setItemTextLabel(item, new JBColor(isSelected ? SELECTED_FOREGROUND_COLOR : presentation.getItemTextForeground(), foreground), isSelected, presentation, allowedWidth); myTypeLabel.clear(); if (allowedWidth > 0) { diff --git a/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java b/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java index 33ba62c1dc6f..3b779a15ce5e 100644 --- a/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java +++ b/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -15,6 +15,7 @@ */ package com.intellij.ui.components.panels; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import javax.swing.*; @@ -74,7 +75,7 @@ public abstract class ValidatingComponent extends NonOpaqu protected JLabel createErrorLabel() { final JLabel label = new JLabel(" "); - label.setForeground(Color.red); + label.setForeground(JBColor.red); label.setFont(ERROR_FONT); return label; }