Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable being able to set the automatic adjustment of indistinguishable text #12160

Merged
5 commits merged into from Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Appearances.cpp
Expand Up @@ -136,6 +136,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
INITIALIZE_BINDABLE_ENUM_SETTING(IntenseTextStyle, IntenseTextStyle, winrt::Microsoft::Terminal::Settings::Model::IntenseStyle, L"Appearance_IntenseTextStyle", L"Content");
}

bool Appearances::ShowIndistinguishableColorsItem() const noexcept
{
return Feature_AdjustIndistinguishableText::IsEnabled();
}

// Method Description:
// - Searches through our list of monospace fonts to determine if the settings model's current font face is a monospace font
bool Appearances::UsingMonospaceFont() const noexcept
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Appearances.h
Expand Up @@ -106,6 +106,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
public:
Appearances();

bool ShowIndistinguishableColorsItem() const noexcept;

// font face
Windows::Foundation::IInspectable CurrentFontFace() const;

Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Appearances.idl
Expand Up @@ -56,6 +56,8 @@ namespace Microsoft.Terminal.Settings.Editor
ProfileViewModel SourceProfile;
static Windows.UI.Xaml.DependencyProperty AppearanceProperty { get; };

Boolean ShowIndistinguishableColorsItem { get; };

Boolean UsingMonospaceFont { get; };
Boolean ShowAllFonts;

Expand Down
3 changes: 2 additions & 1 deletion src/cascadia/TerminalSettingsEditor/Appearances.xaml
Expand Up @@ -158,7 +158,8 @@
<local:SettingContainer x:Uid="Profile_AdjustIndistinguishableColors"
ClearSettingValue="{x:Bind Appearance.ClearAdjustIndistinguishableColors}"
HasSettingValue="{x:Bind Appearance.HasAdjustIndistinguishableColors, Mode=OneWay}"
SettingOverrideSource="{x:Bind Appearance.AdjustIndistinguishableColorsOverrideSource, Mode=OneWay}">
SettingOverrideSource="{x:Bind Appearance.AdjustIndistinguishableColorsOverrideSource, Mode=OneWay}"
Visibility="{x:Bind ShowIndistinguishableColorsItem}">
<ToggleSwitch IsOn="{x:Bind Appearance.AdjustIndistinguishableColors, Mode=TwoWay}" />
</local:SettingContainer>
</StackPanel>
Expand Down
6 changes: 6 additions & 0 deletions src/features.xml
Expand Up @@ -82,4 +82,10 @@
<brandingToken>WindowsInbox</brandingToken>
</alwaysDisabledBrandingTokens>
</feature>

<feature>
<name>Feature_AdjustIndistinguishableText</name>
<description>If enabled, the foreground color will, when necessary, be automatically adjusted to make it more visible.</description>
<stage>AlwaysDisabled</stage>
</feature>
</featureStaging>
3 changes: 2 additions & 1 deletion src/renderer/base/RenderSettings.cpp
Expand Up @@ -186,7 +186,8 @@ std::pair<COLORREF, COLORREF> RenderSettings::GetAttributeColors(const TextAttri

// We want to nudge the foreground color to make it more perceivable only for the
// default color pairs within the color table
if (GetRenderMode(Mode::DistinguishableColors) &&
if (Feature_AdjustIndistinguishableText::IsEnabled() &&
GetRenderMode(Mode::DistinguishableColors) &&
!dimFg &&
(fgTextColor.IsDefault() || fgTextColor.IsLegacy()) &&
(bgTextColor.IsDefault() || bgTextColor.IsLegacy()))
Expand Down