fix search fields for darcula

(cherry picked from commit ddfc4f9c36d2fb81b3f2ca64a6d24eef37875b68)
This commit is contained in:
Konstantin Bulenkov
2012-11-30 14:07:40 +01:00
parent 99a6b6e8de
commit 25c2e4434e
2 changed files with 14 additions and 3 deletions
@@ -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.
@@ -194,6 +194,15 @@ public class SearchTextField extends JPanel {
}
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (UIUtil.isUnderDarcula()) {//todo[kb] fix DarculaTextBorder
g.setColor(myTextField.getBackground());
g.fillRect(2,3,getWidth(), getHeight()-5);
}
}
private static boolean hasNativeLeopardSearchControl() {
return SystemInfo.isMacOSLeopard && UIUtil.isUnderAquaLookAndFeel();
}
@@ -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.
@@ -62,7 +62,9 @@ public abstract class SearchFieldAction extends AnAction implements CustomCompon
Border border = myField.getBorder();
Border emptyBorder = IdeBorderFactory.createEmptyBorder(3, 0, 2, 0);
if (border instanceof CompoundBorder) {
myField.setBorder(new CompoundBorder(emptyBorder, ((CompoundBorder)border).getInsideBorder()));
if (!UIUtil.isUnderDarcula()) {
myField.setBorder(new CompoundBorder(emptyBorder, ((CompoundBorder)border).getInsideBorder()));
}
}
else {
myField.setBorder(emptyBorder);