From f4b288b2cae351228f604fd1a32c9be000e94488 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 22 May 2014 13:37:34 +0200 Subject: [PATCH] fix gray gap in ComboBox under Darcula and IntelliJ lafs --- .../src/com/intellij/ui/EditorTextField.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java index 6664c2ea345a..78258664b3c5 100644 --- a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java +++ b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -603,13 +603,19 @@ public class EditorTextField extends NonOpaquePanel implements DocumentListener, } } + @Override + public Color getBackground() { + final Color color = getBackgroundColor(isEnabled(), EditorColorsManager.getInstance().getGlobalScheme()); + return color != null ? color : super.getBackground(); + } + private Color getBackgroundColor(boolean enabled, final EditorColorsScheme colorsScheme){ if (myEnforcedBgColor != null) return myEnforcedBgColor; - if (UIUtil.getParentOfType(CellRendererPane.class, this) != null && UIUtil.isUnderDarcula()) { + if (UIUtil.getParentOfType(CellRendererPane.class, this) != null && (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())) { return getParent().getBackground(); } - if (UIUtil.isUnderDarcula()) return UIUtil.getTextFieldBackground(); + if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) return UIUtil.getTextFieldBackground(); return enabled ? colorsScheme.getDefaultBackground()