From 7f64473e8791d1a0b6ab28a5be01e4ba2b8eaae7 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Tue, 28 Feb 2017 20:03:33 +0300 Subject: [PATCH] inspection settings: do not use bold IDEA-165091 --- .../options/codeStyle/CodeStyleSchemesPanel.java | 5 +++++ .../intellij/application/options/colors/SchemesPanel.java | 5 +++++ .../application/options/schemes/AbstractSchemesPanel.java | 2 ++ .../application/options/schemes/EditableSchemesCombo.java | 8 ++++++-- .../ui/header/InspectionProfileSchemesPanel.java | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java index 92210885b2c8..7bcac2ea031d 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java @@ -132,4 +132,9 @@ public class CodeStyleSchemesPanel extends SimpleSchemesPanel { protected boolean highlightNonDefaultSchemes() { return true; } + + @Override + public boolean useBoldForNonRemovableSchemes() { + return true; + } } diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java index d00737fee624..52e82ec8be28 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java @@ -118,4 +118,9 @@ public class SchemesPanel extends SimpleSchemesPanel impleme protected boolean highlightNonDefaultSchemes() { return true; } + + @Override + public boolean useBoldForNonRemovableSchemes() { + return true; + } } diff --git a/platform/lang-impl/src/com/intellij/application/options/schemes/AbstractSchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/schemes/AbstractSchemesPanel.java index 800cf9fc2990..a50c884cc465 100644 --- a/platform/lang-impl/src/com/intellij/application/options/schemes/AbstractSchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/schemes/AbstractSchemesPanel.java @@ -181,6 +181,8 @@ public abstract class AbstractSchemesPanel { @Override protected SimpleTextAttributes getSchemeAttributes(T scheme) { SchemesModel model = mySchemesPanel.getModel(); - SimpleTextAttributes baseAttributes = model.canDeleteScheme(scheme) + SimpleTextAttributes baseAttributes = !useBoldForNonRemovableSchemes() || model.canDeleteScheme(scheme) ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES; if (mySchemesPanel.highlightNonDefaultSchemes() && model.canResetScheme(scheme) && model.differsFromDefault(scheme)) { @@ -181,7 +181,7 @@ public class EditableSchemesCombo { } }); } - + public void startEdit() { T scheme = getSelectedScheme(); if (scheme != null) { @@ -210,6 +210,10 @@ public class EditableSchemesCombo { return myRootPanel; } + private boolean useBoldForNonRemovableSchemes() { + return mySchemesPanel.useBoldForNonRemovableSchemes(); + } + @Nullable private String validateSchemeName(@NotNull String name, boolean isProjectScheme) { if (name.isEmpty()) { diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionProfileSchemesPanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionProfileSchemesPanel.java index 3818af8f329b..ec6d4390de57 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionProfileSchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionProfileSchemesPanel.java @@ -105,6 +105,11 @@ public class InspectionProfileSchemesPanel extends AbstractDescriptionAwareSchem return false; } + @Override + public boolean useBoldForNonRemovableSchemes() { + return false; + } + @Override protected AbstractSchemeActions createSchemeActions() { return new DescriptionAwareSchemeActions(this) {