diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp index 8cf0079138a..a74843e8199 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.cpp +++ b/src/cascadia/TerminalSettingsEditor/Appearances.cpp @@ -114,7 +114,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation DependencyProperty Appearances::_AppearanceProperty{ nullptr }; Appearances::Appearances() : - _ShowAllFonts{ false } + _ShowAllFonts{ false }, + _ShowProportionalFontWarning{ false } { InitializeComponent(); @@ -239,6 +240,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation const auto selectedItem{ e.AddedItems().GetAt(0) }; const auto newFontFace{ unbox_value(selectedItem) }; Appearance().FontFace(newFontFace.LocalizedName()); + if (!UsingMonospaceFont()) + { + ShowProportionalFontWarning(true); + } + else + { + ShowProportionalFontWarning(false); + } } void Appearances::_ViewModelChanged(const DependencyObject& d, const DependencyPropertyChangedEventArgs& /*args*/) @@ -300,6 +309,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"CurrentAdjustIndistinguishableColors" }); } + else if (settingName == L"ShowProportionalFontWarning") + { + _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"ShowProportionalFontWarning" }); + } // YOU THERE ADDING A NEW APPEARANCE SETTING // Make sure you add a block like // @@ -331,6 +344,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"UsingMonospaceFont" }); _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"CurrentIntenseTextStyle" }); _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"CurrentAdjustIndistinguishableColors" }); + _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"ShowProportionalFontWarning" }); } } @@ -411,4 +425,5 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // whereas SelectedItem identifies which one was selected by the user. return FontWeightComboBox().SelectedItem() == _CustomFontWeight; } + } diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.h b/src/cascadia/TerminalSettingsEditor/Appearances.h index 13f4719a30d..f6be156bc88 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.h +++ b/src/cascadia/TerminalSettingsEditor/Appearances.h @@ -134,10 +134,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation DEPENDENCY_PROPERTY(Editor::AppearanceViewModel, Appearance); WINRT_PROPERTY(Editor::ProfileViewModel, SourceProfile, nullptr); WINRT_PROPERTY(IHostedInWindow, WindowRoot, nullptr); - GETSET_BINDABLE_ENUM_SETTING(BackgroundImageStretchMode, Windows::UI::Xaml::Media::Stretch, Appearance().BackgroundImageStretchMode); GETSET_BINDABLE_ENUM_SETTING(IntenseTextStyle, Microsoft::Terminal::Settings::Model::IntenseStyle, Appearance().IntenseTextStyle); + WINRT_OBSERVABLE_PROPERTY(bool, ShowProportionalFontWarning, _PropertyChangedHandlers, nullptr); private: bool _ShowAllFonts; diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.idl b/src/cascadia/TerminalSettingsEditor/Appearances.idl index 2a83e44459d..acddd41fda6 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.idl +++ b/src/cascadia/TerminalSettingsEditor/Appearances.idl @@ -63,6 +63,7 @@ namespace Microsoft.Terminal.Settings.Editor Boolean UsingMonospaceFont { get; }; Boolean ShowAllFonts; + Boolean ShowProportionalFontWarning; IInspectable CurrentCursorShape; Boolean IsVintageCursor { get; }; diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.xaml b/src/cascadia/TerminalSettingsEditor/Appearances.xaml index 076522ff877..349e9172df4 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml +++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml @@ -179,11 +179,13 @@ + + Learn more. A hyperlink displayed near Settings_PortableModeNote.Text that the user can follow for more information. + + + Warning: + Title for the warning info bar used when a non monospace font face is chosen to indicate that there may be visual artifacts + + + Choosing a non-monospaced font will likely result in visual artifacts. Use at your own discretion. + Warning info bar used when a non monospace font face is chosen to indicate that there may be visual artifacts