From 25c2e4434e2c23e4a840183b8f7b2f8a2b243c5e Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 29 Nov 2012 17:37:53 +0100 Subject: [PATCH] fix search fields for darcula (cherry picked from commit ddfc4f9c36d2fb81b3f2ca64a6d24eef37875b68) --- .../src/com/intellij/ui/SearchTextField.java | 11 ++++++++++- .../intellij/openapi/vcs/ui/SearchFieldAction.java | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/SearchTextField.java b/platform/platform-api/src/com/intellij/ui/SearchTextField.java index 9909e35da2a5..6644f6ca8543 100644 --- a/platform/platform-api/src/com/intellij/ui/SearchTextField.java +++ b/platform/platform-api/src/com/intellij/ui/SearchTextField.java @@ -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(); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java index 6dbb5747ed87..960d1af4814b 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/ui/SearchFieldAction.java @@ -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);