From 90c52504972838aa26aca5cd67e60ad0366b1d55 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 22 Jun 2017 01:19:32 +0300 Subject: [PATCH] go to actions: use gray for selected but disabled items --- .../intellij/ide/util/gotoByName/GotoActionModel.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java index 8d48f77ebc68..6a66ee4c4696 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java @@ -274,8 +274,8 @@ public class GotoActionModel implements ChooseByNameModel, Comparator, D } public static Color defaultActionForeground(boolean isSelected, @Nullable Presentation presentation) { - if (isSelected) return UIUtil.getListSelectionForeground(); if (presentation != null && (!presentation.isEnabled() || !presentation.isVisible())) return UIUtil.getInactiveTextColor(); + if (isSelected) return UIUtil.getListSelectionForeground(); return UIUtil.getListForeground(); } @@ -589,7 +589,14 @@ public class GotoActionModel implements ChooseByNameModel, Comparator, D Presentation presentation = anAction.getTemplatePresentation(); boolean toggle = anAction instanceof ToggleAction; String groupName = actionWithParentGroup.getAction() instanceof ApplyIntentionAction ? null : actionWithParentGroup.getGroupName(); - Color fg = defaultActionForeground(isSelected, actionWithParentGroup.getPresentation()); + Presentation actionPresentation = actionWithParentGroup.getPresentation(); + Color fg = defaultActionForeground(isSelected, actionPresentation); + boolean disabled = actionPresentation != null && (!actionPresentation.isEnabled() || !actionPresentation.isVisible()); + + if (disabled) { + groupFg = UIUtil.getLabelDisabledForeground(); + } + if (showIcon) { panel.add(createIconLabel(presentation.getIcon()), BorderLayout.WEST); }