problems with file colors and bg painting

This commit is contained in:
Konstantin Bulenkov
2012-07-26 15:22:26 +02:00
parent 4ca0296da7
commit 822769a0c7
4 changed files with 9 additions and 5 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2010 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.
@@ -40,6 +40,7 @@ public class NonProjectFilesScope extends NamedScope {
super(NAME, new AbstractPackageSet("NonProject") {
public boolean contains(VirtualFile file, NamedScopesHolder holder) {
if (file == null) return true;
if (file.getFileSystem() != LocalFileSystem.getInstance()) return true;
if (isInsideProjectContent(holder.getProject(), file)) return false;
return !ProjectScope.getProjectScope(holder.getProject()).contains(file);
}
@@ -64,9 +64,11 @@ public abstract class ColoredTreeCellRenderer extends SimpleColoredComponent imp
if (UIUtil.isFullRowSelectionLAF()) {
setBackground(selected ? UIUtil.getTreeSelectionBackground() : null);
}
else if (/*UIUtil.isUnderAquaBasedLookAndFeel() && */tree.getUI() instanceof WideSelectionTreeUI && ((WideSelectionTreeUI)tree.getUI()).isWideSelection()) {
else if (tree.getUI() instanceof WideSelectionTreeUI && ((WideSelectionTreeUI)tree.getUI()).isWideSelection()) {
setPaintFocusBorder(false);
//setBackground(selected ? UIUtil.getTreeSelectionBackground() : null);
if (selected) {
setBackground(hasFocus ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeUnfocusedSelectionBackground());
}
}
else {
if (selected) {
@@ -34,8 +34,9 @@ public class ColorUtil {
}
public static Color softer(@NotNull Color color) {
if (color.getBlue() > 220 && color.getRed() > 220 && color.getGreen() > 220) return color;
final float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
return Color.getHSBColor(hsb[0], 0.4f *hsb[1], hsb[2]);
return Color.getHSBColor(hsb[0], 0.6f *hsb[1], hsb[2]);
}
private static int shift(int colorComponent, double d) {
@@ -947,7 +947,7 @@ public class UIUtil {
}
public static boolean isFullRowSelectionLAF() {
return isUnderNimbusLookAndFeel() || isUnderQuaquaLookAndFeel() || isUnderDarcula();
return isUnderNimbusLookAndFeel() || isUnderQuaquaLookAndFeel();
}
public static boolean isUnderNativeMacLookAndFeel() {