diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateTabAsList.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateTabAsList.java index fa640e60d8b5..f913a8eee8a3 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateTabAsList.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateTabAsList.java @@ -21,6 +21,7 @@ import com.intellij.ide.fileTemplates.FileTemplateUtil; import com.intellij.ui.ListSpeedSearch; import com.intellij.ui.components.JBList; import com.intellij.util.Function; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -51,7 +52,7 @@ abstract class FileTemplateTabAsList extends FileTemplateTab { private class MyListCellRenderer extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + super.getListCellRendererComponent(list, value, index, isSelected, false); Icon icon = null; if (value instanceof FileTemplate) { FileTemplate template = (FileTemplate) value; @@ -73,6 +74,7 @@ abstract class FileTemplateTabAsList extends FileTemplateTab { } } setIcon(icon); + if (isSelected) setBackground(UIUtil.getListSelectionBackground(cellHasFocus)); return this; } } diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 776b9dc3b96f..3fbf8b24ea4c 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -1363,6 +1363,10 @@ public class UIUtil { return new JBColor(UNFOCUSED_SELECTION_COLOR, new Color(13, 41, 62)); } + public static Color getListSelectionBackground(boolean focused) { + return focused ? getListSelectionBackground() : getListUnfocusedSelectionBackground(); + } + public static Color getTreeSelectionBackground(boolean focused) { return focused ? getTreeSelectionBackground() : getTreeUnfocusedSelectionBackground(); }