From 07d9d91dfa8ec7489338d635104cf72ae5110496 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 25 Apr 2012 13:25:32 +0200 Subject: [PATCH] +colors to the commit list --- .../vcs/changes/ui/ChangesTreeList.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java index 943e25373473..aca0badcd84e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java @@ -784,6 +784,30 @@ public abstract class ChangesTreeList extends JPanel { append(part.getFirst(), part.getSecond().derive(SimpleTextAttributes.GRAYED_ATTRIBUTES)); } } + + @Override + public Component getListCellRendererComponent(JList list, + Object value, + int index, + boolean selected, + boolean hasFocus) { + final Component component = super.getListCellRendererComponent(list, value, index, selected, hasFocus); + final FileColorManager colorManager = FileColorManager.getInstance(myProject); + if (!selected) { + if (Registry.is("file.colors.in.commit.dialog") && colorManager.isEnabled() && colorManager.isEnabledForProjectView()) { + if (value instanceof Change) { + final VirtualFile file = ((Change)value).getVirtualFile(); + if (file != null) { + final Color color = colorManager.getFileColor(file); + if (color != null) { + component.setBackground(color); + } + } + } + } + } + return component; + } }; myCheckbox.setBackground(null);