diff --git a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp index 2b2fad9322..ab21bb75e0 100644 --- a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp +++ b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp @@ -69,6 +69,22 @@ namespace winrt::Microsoft::Terminal::Settings return settings; } + // Method Description: + // - Like CreateForPreview, but overlays the profile's unfocused appearance on top of the + // resolved focused settings so the preview reflects the unfocused appearance. If the profile + // has no unfocused appearance, this behaves like CreateForPreview (the focused appearance). + winrt::com_ptr TerminalSettings::CreateForPreviewUnfocused(const Model::CascadiaSettings& appSettings, const Model::Profile& profile) + { + const auto settings = _CreateWithProfileCommon(appSettings, profile); + settings->_UseBackgroundImageForWindow = false; + if (const auto& unfocusedAppearance{ profile.UnfocusedAppearance() }) + { + const auto globals = appSettings.GlobalSettings(); + settings->_ApplyAppearanceSettings(unfocusedAppearance, globals.ColorSchemes(), globals.CurrentTheme()); + } + return settings; + } + // Method Description: // - Create a TerminalSettingsCreateResult for the provided profile guid. We'll // use the guid to look up the profile that should be used to diff --git a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h index ff714dfc5c..642ce74815 100644 --- a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h +++ b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h @@ -58,6 +58,7 @@ namespace winrt::Microsoft::Terminal::Settings TerminalSettings() = default; static winrt::com_ptr CreateForPreview(const Model::CascadiaSettings& appSettings, const Model::Profile& profile); + static winrt::com_ptr CreateForPreviewUnfocused(const Model::CascadiaSettings& appSettings, const Model::Profile& profile); static TerminalSettingsCreateResult CreateWithProfile(const Model::CascadiaSettings& appSettings, const Model::Profile& profile); diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp index a02a6fd2a3..9b18700009 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.cpp +++ b/src/cascadia/TerminalSettingsEditor/Appearances.cpp @@ -247,7 +247,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } else if (viewModelProperty == L"DarkColorSchemeName" || viewModelProperty == L"LightColorSchemeName") { - _NotifyChanges(L"CurrentColorScheme"); + _NotifyChanges(L"CurrentColorScheme", L"ColorScheme", L"HasColorScheme"); } else if (viewModelProperty == L"CurrentColorScheme") { @@ -1010,6 +1010,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void AppearanceViewModel::ClearColorScheme() { ClearDarkColorSchemeName(); + ClearLightColorSchemeName(); _NotifyChanges(L"CurrentColorScheme"); } diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.h b/src/cascadia/TerminalSettingsEditor/Appearances.h index db51c0fd8e..21d161f6db 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.h +++ b/src/cascadia/TerminalSettingsEditor/Appearances.h @@ -155,30 +155,30 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // dispatch, but no property is generated for it here. // "ColorScheme" is special-cased in the dispatch (it is backed by the Dark/Light // scheme names) and so is intentionally not listed here. -#define APPEARANCE_INHERITABLE_SETTINGS(PROJECTED, CUSTOM) \ - CUSTOM(FontFace) \ - PROJECTED(_appearance.SourceProfile().FontInfo(), FontSize) \ - CUSTOM(LineHeight) \ - CUSTOM(CellWidth) \ - PROJECTED(_appearance.SourceProfile().FontInfo(), FontWeight) \ +#define APPEARANCE_INHERITABLE_SETTINGS(PROJECTED, CUSTOM) \ + CUSTOM(FontFace) \ + PROJECTED(_appearance.SourceProfile().FontInfo(), FontSize) \ + CUSTOM(LineHeight) \ + CUSTOM(CellWidth) \ + PROJECTED(_appearance.SourceProfile().FontInfo(), FontWeight) \ PROJECTED(_appearance.SourceProfile().FontInfo(), EnableBuiltinGlyphs) \ PROJECTED(_appearance.SourceProfile().FontInfo(), EnableColorGlyphs) \ - CUSTOM(FontAxes) \ - CUSTOM(FontFeatures) \ - PROJECTED(_appearance, RetroTerminalEffect) \ - PROJECTED(_appearance, CursorShape) \ - PROJECTED(_appearance, CursorHeight) \ - PROJECTED(_appearance, DarkColorSchemeName) \ - PROJECTED(_appearance, LightColorSchemeName) \ - PROJECTED(_appearance, BackgroundImagePath) \ - PROJECTED(_appearance, BackgroundImageOpacity) \ - PROJECTED(_appearance, BackgroundImageStretchMode) \ - PROJECTED(_appearance, BackgroundImageAlignment) \ - PROJECTED(_appearance, IntenseTextStyle) \ - PROJECTED(_appearance, AdjustIndistinguishableColors) \ - PROJECTED(_appearance, Foreground) \ - PROJECTED(_appearance, Background) \ - PROJECTED(_appearance, SelectionBackground) \ + CUSTOM(FontAxes) \ + CUSTOM(FontFeatures) \ + PROJECTED(_appearance, RetroTerminalEffect) \ + PROJECTED(_appearance, CursorShape) \ + PROJECTED(_appearance, CursorHeight) \ + PROJECTED(_appearance, DarkColorSchemeName) \ + PROJECTED(_appearance, LightColorSchemeName) \ + PROJECTED(_appearance, BackgroundImagePath) \ + PROJECTED(_appearance, BackgroundImageOpacity) \ + PROJECTED(_appearance, BackgroundImageStretchMode) \ + PROJECTED(_appearance, BackgroundImageAlignment) \ + PROJECTED(_appearance, IntenseTextStyle) \ + PROJECTED(_appearance, AdjustIndistinguishableColors) \ + PROJECTED(_appearance, Foreground) \ + PROJECTED(_appearance, Background) \ + PROJECTED(_appearance, SelectionBackground) \ PROJECTED(_appearance, CursorColor) #define APPEARANCE_GEN_PROJECTED(target, name) OBSERVABLE_PROJECTED_SETTING(target, name); diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.xaml b/src/cascadia/TerminalSettingsEditor/Appearances.xaml index c421d222d0..f548e6d2a7 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml +++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml @@ -72,7 +72,12 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ItemsSource="{x:Bind Appearance.SchemesList, Mode=OneWay}" + SelectedItem="{x:Bind Appearance.CurrentColorScheme, Mode=TwoWay}" + Style="{StaticResource ComboBoxSettingStyle}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -284,159 +289,163 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x:Uid="Profile_FontAxes" + Margin="0,4,0,0"> @@ -468,7 +477,8 @@ + x:Uid="Profile_FontFeatures" + Margin="0,4,0,0"> @@ -502,7 +512,8 @@ + x:Uid="Profile_EnableBuiltinGlyphs" + Margin="0,4,0,0"> + x:Uid="Profile_EnableColorGlyphs" + Margin="0,4,0,0"> + x:Uid="Profile_RetroTerminalEffect" + Margin="0,4,0,0"> + x:Uid="Profile_AdjustIndistinguishableColors" + Margin="0,4,0,0"> (), winrt::make(profile, *this, elementToFocus)); _breadcrumbs.Append(winrt::make(breadcrumbTag, RS_(L"Profile_Appearance/Header"), BreadcrumbSubPage::Profile_Appearance)); } + else if (page == ProfileSubPage::UnfocusedAppearance) + { + contentFrame().Navigate(xaml_typename(), winrt::make(profile, *this, elementToFocus)); + _breadcrumbs.Append(winrt::make(breadcrumbTag, RS_(L"Profile_UnfocusedAppearanceTextBlock/Text"), BreadcrumbSubPage::Profile_UnfocusedAppearance)); + } else if (page == ProfileSubPage::Terminal) { contentFrame().Navigate(xaml_typename(), winrt::make(profile, *this, elementToFocus)); diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.idl b/src/cascadia/TerminalSettingsEditor/MainPage.idl index e0f3dcbea9..0e528fe02d 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.idl +++ b/src/cascadia/TerminalSettingsEditor/MainPage.idl @@ -35,6 +35,7 @@ namespace Microsoft.Terminal.Settings.Editor { None = 0, Profile_Appearance, + Profile_UnfocusedAppearance, Profile_Terminal, Profile_Advanced, ColorSchemes_Edit, diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj index e8913d9dcd..0e01f2d131 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj @@ -159,6 +159,10 @@ Profiles_Appearance.xaml Code + + Profiles_UnfocusedAppearance.xaml + Code + Profiles_Terminal.xaml Code @@ -249,6 +253,9 @@ Designer + + Designer + Designer @@ -383,6 +390,10 @@ Profiles_Appearance.xaml Code + + Profiles_UnfocusedAppearance.xaml + Code + Profiles_Terminal.xaml Code @@ -502,6 +513,10 @@ Profiles_Appearance.xaml Code + + Profiles_UnfocusedAppearance.xaml + Code + Profiles_Terminal.xaml Code diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters index e3ac3f6151..633610f840 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters @@ -50,6 +50,7 @@ + diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp index 4419940cbf..30ec268dae 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp @@ -193,6 +193,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { return _parsedPadding.Bottom; } + Control::IControlSettings ProfileViewModel::TermSettings() const { // This may look pricey, but it only resolves resources that have not been visited @@ -201,6 +202,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation return *Settings::TerminalSettings::CreateForPreview(_appSettings, _profile); } + Control::IControlSettings ProfileViewModel::TermSettingsUnfocused() const + { + // This may look pricey, but it only resolves resources that have not been visited + // and the preview update is debounced. + _appSettings.ResolveMediaResources(); + return *Settings::TerminalSettings::CreateForPreviewUnfocused(_appSettings, _profile); + } + // Method Description: // - Updates the lists of fonts and sorts them alphabetically void ProfileViewModel::UpdateFontList() noexcept @@ -361,9 +370,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation Windows::Foundation::IInspectable ProfileViewModel::SettingOverrideSource(const hstring& name) { const std::wstring_view n{ name }; -#define HANDLE(Setting) \ - if (n == L## #Setting) \ - { \ +#define HANDLE(Setting) \ + if (n == L## #Setting) \ + { \ return Setting##OverrideSource(); \ } #define HANDLE_PROJECTED(target, Setting) HANDLE(Setting) @@ -481,6 +490,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation return EditableUnfocusedAppearance() && HasUnfocusedAppearance(); } + hstring ProfileViewModel::UnfocusedAppearanceCardValue() + { + return HasUnfocusedAppearance() ? hstring{} : RS_(L"Profile_UnfocusedAppearanceNone"); + } + void ProfileViewModel::CreateUnfocusedAppearance() { _profile.CreateUnfocusedAppearance(); @@ -488,7 +502,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _unfocusedAppearanceViewModel = winrt::make(_profile.UnfocusedAppearance().try_as()); _unfocusedAppearanceViewModel.SchemesList(DefaultAppearance().SchemesList()); - _NotifyChanges(L"UnfocusedAppearance", L"HasUnfocusedAppearance", L"ShowUnfocusedAppearance"); + _NotifyChanges(L"UnfocusedAppearance", L"HasUnfocusedAppearance", L"ShowUnfocusedAppearance", L"UnfocusedAppearanceCardValue"); } void ProfileViewModel::DeleteUnfocusedAppearance() @@ -497,7 +511,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _unfocusedAppearanceViewModel = nullptr; - _NotifyChanges(L"UnfocusedAppearance", L"HasUnfocusedAppearance", L"ShowUnfocusedAppearance"); + _NotifyChanges(L"UnfocusedAppearance", L"HasUnfocusedAppearance", L"ShowUnfocusedAppearance", L"UnfocusedAppearanceCardValue"); } Editor::AppearanceViewModel ProfileViewModel::UnfocusedAppearance() const diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h index a4bc8cdd14..24218ad255 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h @@ -36,6 +36,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation ProfileViewModel(const Model::Profile& profile, const Model::CascadiaSettings& settings, const Windows::UI::Core::CoreDispatcher& dispatcher); Control::IControlSettings TermSettings() const; + Control::IControlSettings TermSettingsUnfocused() const; void DeleteProfile(); void SetupAppearances(Windows::Foundation::Collections::IObservableVector schemesList); @@ -93,6 +94,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation bool HasUnfocusedAppearance(); bool EditableUnfocusedAppearance() const noexcept; bool ShowUnfocusedAppearance(); + hstring UnfocusedAppearanceCardValue(); void CreateUnfocusedAppearance(); void DeleteUnfocusedAppearance(); @@ -121,7 +123,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // Settings that expose a reset button. // Wired into both the property accessors and the reset dispatch automatically. -#define PROFILE_INHERITABLE_SETTINGS(X) \ +#define PROFILE_INHERITABLE_SETTINGS(X) \ X(_profile, Name) \ X(_profile, Hidden) \ X(_profile, Icon) \ diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl index a858ce7654..d4b651c3a8 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl @@ -33,7 +33,8 @@ namespace Microsoft.Terminal.Settings.Editor Base = 0, Appearance = 1, Terminal = 2, - Advanced = 3 + Advanced = 3, + UnfocusedAppearance = 4 }; runtimeclass ProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged, IInheritableViewModel @@ -85,6 +86,7 @@ namespace Microsoft.Terminal.Settings.Editor Boolean HasUnfocusedAppearance { get; }; Boolean EditableUnfocusedAppearance { get; }; Boolean ShowUnfocusedAppearance { get; }; + String UnfocusedAppearanceCardValue { get; }; AppearanceViewModel UnfocusedAppearance { get; }; Boolean ShowMarksAvailable { get; }; diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp index e817b20020..7e6b1554fe 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp @@ -82,26 +82,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _AppearanceViewModelChangedRevoker.revoke(); } - void Profiles_Appearance::CreateUnfocusedAppearance_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) - { - TraceLoggingWrite( - g_hTerminalSettingsEditorProvider, - "CreateUnfocusedAppearance", - TraceLoggingDescription("Event emitted when the user creates an unfocused appearance for a profile"), - TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), - TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), - TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), - TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), - TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); - - _Profile.CreateUnfocusedAppearance(); - } - - void Profiles_Appearance::DeleteUnfocusedAppearance_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) - { - _Profile.DeleteUnfocusedAppearance(); - } - void Profiles_Appearance::_onProfilePropertyChanged(const IInspectable&, const PropertyChangedEventArgs&) { if (!_updatePreviewControl) diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.h b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.h index 5f26cf6897..9438d77091 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.h +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.h @@ -19,9 +19,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void OnNavigatedTo(const Windows::UI::Xaml::Navigation::NavigationEventArgs& e); void OnNavigatedFrom(const Windows::UI::Xaml::Navigation::NavigationEventArgs& e); - void CreateUnfocusedAppearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); - void DeleteUnfocusedAppearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); - Editor::IHostedInWindow WindowRoot() const noexcept { return _weakWindowRoot.get(); }; til::property_changed_event PropertyChanged; diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.xaml b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.xaml index 1439dfac91..6e2e7bea87 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.xaml +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.xaml @@ -216,59 +216,6 @@ - - - - - - - - - - - - - - diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp index 6a4d651d3b..b1426da5e4 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp @@ -23,6 +23,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation AppearanceNavigator().Header(box_value(RS_(L"Profile_Appearance/Header"))); AppearanceNavigator().Description(box_value(RS_(L"Profile_AppearanceNavigator/Description"))); + UnfocusedAppearanceNavigator().Header(box_value(RS_(L"Profile_UnfocusedAppearanceTextBlock/Text"))); + UnfocusedAppearanceNavigator().Description(box_value(RS_(L"Profile_UnfocusedAppearanceNavigator/Description"))); TerminalNavigator().Header(box_value(RS_(L"Profile_Terminal/Header"))); TerminalNavigator().Description(box_value(RS_(L"Profile_TerminalNavigator/Description"))); AdvancedNavigator().Header(box_value(RS_(L"Profile_Advanced/Header"))); @@ -79,6 +81,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Profile.CurrentPage(ProfileSubPage::Appearance); } + void Profiles_Base::UnfocusedAppearance_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*args*/) + { + _Profile.CurrentPage(ProfileSubPage::UnfocusedAppearance); + } + void Profiles_Base::Terminal_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*args*/) { _Profile.CurrentPage(ProfileSubPage::Terminal); diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.h b/src/cascadia/TerminalSettingsEditor/Profiles_Base.h index 2fa4ab7225..d010438c6b 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.h +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.h @@ -20,6 +20,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation safe_void_coroutine StartingDirectory_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); safe_void_coroutine Commandline_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void Appearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); + void UnfocusedAppearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void Terminal_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void Advanced_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void DeleteConfirmation_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml b/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml index 4b5b5f3349..ce467e196e 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml @@ -228,6 +228,17 @@ + + + + + + diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.cpp new file mode 100644 index 0000000000..0b2ac31556 --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.cpp @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#include "pch.h" +#include "Profiles_UnfocusedAppearance.h" +#include "Appearances.h" + +#include "ProfileViewModel.h" +#include "PreviewConnection.h" + +#include "Profiles_UnfocusedAppearance.g.cpp" + +using namespace winrt::Windows::UI::Xaml; +using namespace winrt::Windows::UI::Xaml::Navigation; + +static constexpr std::wstring_view AppearanceSettingPrefix{ L"App." }; + +namespace winrt::Microsoft::Terminal::Settings::Editor::implementation +{ + Profiles_UnfocusedAppearance::Profiles_UnfocusedAppearance() + { + InitializeComponent(); + _previewConnection = winrt::make_self(); + } + + void Profiles_UnfocusedAppearance::OnNavigatedTo(const NavigationEventArgs& e) + { + const auto args = e.Parameter().as(); + _Profile = args.ViewModel().as(); + _weakWindowRoot = args.WindowRoot(); + + // Auto-create the unfocused appearance on navigate so the preview and editor are ready to go. + if (!_Profile.HasUnfocusedAppearance()) + { + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "CreateUnfocusedAppearance", + TraceLoggingDescription("Event emitted when the user creates an unfocused appearance for a profile"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + + _Profile.CreateUnfocusedAppearance(); + } + + // Settings are stored in Profiles_UnfocusedAppearance and Appearances. + // We use the "App." prefix to indicate if it's in Appearances, + // and remove it on the way to Appearances object. + const auto elementToFocus = args.ElementToFocus(); + if (elementToFocus.starts_with(AppearanceSettingPrefix)) + { + std::wstring correctedName{ elementToFocus.c_str() }; + get_self(UnfocusedAppearanceView())->BringIntoViewWhenLoaded(hstring{ correctedName.substr(AppearanceSettingPrefix.size()) }); + } + else + { + BringIntoViewWhenLoaded(elementToFocus); + } + + if (!_previewControl) + { + const auto settings = winrt::get_self(_Profile)->TermSettingsUnfocused(); + _previewConnection->DisplayPowerlineGlyphs(_Profile.UnfocusedAppearance().HasPowerlineCharacters()); + _previewControl = Control::TermControl(settings, settings, *_previewConnection); + _previewControl.CursorVisibility(Control::CursorDisplayState::Shown); + _previewControl.IsEnabled(false); + _previewControl.AllowFocusWhenDisabled(false); + ControlPreview().Child(_previewControl); + } + + // Subscribe to some changes in the view model + // These changes should force us to update our own set of "Current" members, + // and propagate those changes to the UI + _ViewModelChangedRevoker = _Profile.PropertyChanged(winrt::auto_revoke, { this, &Profiles_UnfocusedAppearance::_onProfilePropertyChanged }); + // The Appearances object handles updating the values in the settings UI, but + // we still need to listen to the changes here just to update the preview control + _AppearanceViewModelChangedRevoker = _Profile.UnfocusedAppearance().PropertyChanged(winrt::auto_revoke, { this, &Profiles_UnfocusedAppearance::_onProfilePropertyChanged }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profile.unfocusedAppearance", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + } + + void Profiles_UnfocusedAppearance::OnNavigatedFrom(const NavigationEventArgs& /*e*/) + { + _ViewModelChangedRevoker.revoke(); + _AppearanceViewModelChangedRevoker.revoke(); + } + + void Profiles_UnfocusedAppearance::DeleteUnfocusedAppearance_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) + { + // Stop listening to the unfocused appearance before it goes away. + _AppearanceViewModelChangedRevoker.revoke(); + _Profile.DeleteUnfocusedAppearance(); + + // Return to the base profile page now that there's no unfocused appearance to edit. + _Profile.CurrentPage(ProfileSubPage::Base); + } + + void Profiles_UnfocusedAppearance::_onProfilePropertyChanged(const IInspectable&, const PropertyChangedEventArgs&) + { + if (!_updatePreviewControl) + { + _updatePreviewControl = std::make_shared>( + winrt::Windows::System::DispatcherQueue::GetForCurrentThread(), + til::throttled_func_options{ + .delay = std::chrono::milliseconds{ 100 }, + .debounce = true, + .trailing = true, + }, + [this]() { + if (!_Profile.HasUnfocusedAppearance()) + { + return; + } + const auto settings = winrt::get_self(_Profile)->TermSettingsUnfocused(); + _previewConnection->DisplayPowerlineGlyphs(_Profile.UnfocusedAppearance().HasPowerlineCharacters()); + _previewControl.UpdateControlSettings(settings, settings); + }); + } + + _updatePreviewControl->Run(); + } +} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.h b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.h new file mode 100644 index 0000000000..c4a02c416a --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.h @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#pragma once + +#include + +#include "Profiles_UnfocusedAppearance.g.h" +#include "PreviewConnection.h" +#include "Utils.h" + +namespace winrt::Microsoft::Terminal::Settings::Editor::implementation +{ + struct Profiles_UnfocusedAppearance : public HasScrollViewer, Profiles_UnfocusedAppearanceT + { + public: + Profiles_UnfocusedAppearance(); + + void OnNavigatedTo(const Windows::UI::Xaml::Navigation::NavigationEventArgs& e); + void OnNavigatedFrom(const Windows::UI::Xaml::Navigation::NavigationEventArgs& e); + + void DeleteUnfocusedAppearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); + + Editor::IHostedInWindow WindowRoot() const noexcept { return _weakWindowRoot.get(); }; + + til::property_changed_event PropertyChanged; + WINRT_PROPERTY(Editor::ProfileViewModel, Profile, nullptr); + + private: + void _onProfilePropertyChanged(const IInspectable&, const PropertyChangedEventArgs&); + + winrt::com_ptr _previewConnection{ nullptr }; + Microsoft::Terminal::Control::TermControl _previewControl{ nullptr }; + std::shared_ptr> _updatePreviewControl; + Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _ViewModelChangedRevoker; + Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _AppearanceViewModelChangedRevoker; + winrt::weak_ref _weakWindowRoot; + }; +}; + +namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation +{ + BASIC_FACTORY(Profiles_UnfocusedAppearance); +} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.idl b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.idl new file mode 100644 index 0000000000..2ce57f4621 --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.idl @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import "ProfileViewModel.idl"; + +namespace Microsoft.Terminal.Settings.Editor +{ + [default_interface] runtimeclass Profiles_UnfocusedAppearance : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Profiles_UnfocusedAppearance(); + ProfileViewModel Profile { get; }; + IHostedInWindow WindowRoot { get; }; + } +} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.xaml b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.xaml new file mode 100644 index 0000000000..0a1057c66a --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/Profiles_UnfocusedAppearance.xaml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw index 28d8bd8e48..ca099cd8d6 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw @@ -1241,10 +1241,6 @@ Unscharfes Erscheinungsbild The header for the section where the unfocused appearance settings can be changed. - - Erscheinungsbild erstellen - Button label that adds an unfocused appearance for this profile. - Löschen Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Wenn diese Option aktiviert ist, werden alle installierten Schriftarten in der Liste oben angezeigt. Andernfalls wird nur die Liste der Schriftarten mit fester Breite angezeigt. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Erscheinungsbild erstellen - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Erstellen Sie ein unscharfes Erscheinungsbild für dieses Profil. So sieht das Profil aus, als ob es inaktiv ist. - A description for what the create unfocused appearance button does. - Erscheinungsbild löschen Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw index c18e600e1a..4344b2dc8a 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw @@ -757,6 +757,10 @@ Appearance Header for a sub-page of profile settings focused on customizing the appearance of the profile. + + None + Shown on the "Unfocused appearance" navigator card when no unfocused appearance has been defined for the profile. + Background image path Name for a control to determine the image presented on the background of the app. @@ -1241,10 +1245,6 @@ Unfocused appearance The header for the section where the unfocused appearance settings can be changed. - - Create Appearance - Button label that adds an unfocused appearance for this profile. - Delete Button label that deletes the unfocused appearance for this profile. @@ -1593,6 +1593,10 @@ Customize the visual appearance of the profile, including colors, fonts, and text styling. Description shown below the "Appearance" navigator card on the profile page. + + Customize the appearance of the profile when it is inactive (unfocused). + Description shown below the "Unfocused appearance" navigator card on the profile page. + Configure how the terminal interprets text and control sequences to behave like a traditional command-line terminal Description shown below the "Terminal Emulation" navigator card on the profile page. @@ -1769,14 +1773,6 @@ If enabled, show all installed fonts in the list above. Otherwise, only show the list of monospace fonts. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Create Appearance - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Create an unfocused appearance for this profile. This will be the appearance of the profile when it is inactive. - A description for what the create unfocused appearance button does. - Delete Appearance Name for a control which deletes the unfocused appearance settings for this profile. @@ -1785,6 +1781,14 @@ Delete the unfocused appearance for this profile. A description for what the delete unfocused appearance button does. + + Delete this unfocused appearance + Header for a settings card that deletes the profile's unfocused appearance. + + + Removes the unfocused appearance so the profile uses its default appearance when inactive + Description for the delete unfocused appearance settings card. + Learn more about actions Disclaimer presented at the top of the actions page to redirect the user to documentation regarding actions. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw index 9c190ee700..034f767971 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw @@ -1241,10 +1241,6 @@ Apariencia desenfocada The header for the section where the unfocused appearance settings can be changed. - - Crear apariencia - Button label that adds an unfocused appearance for this profile. - Eliminar Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Si está habilitada, muestra todas las fuentes instaladas en la lista anterior. De lo contrario, mostrar solo la lista de fuentes monoespacios. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Crear apariencia - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Crea una apariencia no centrada para este perfil. Esta será la apariencia del perfil cuando esté inactivo. - A description for what the create unfocused appearance button does. - Eliminar apariencia Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw index b184489ffc..b888b5d17b 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw @@ -1241,10 +1241,6 @@ Apparence sans focus The header for the section where the unfocused appearance settings can be changed. - - Créer une apparence - Button label that adds an unfocused appearance for this profile. - Supprimer Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Si cette option est activée, toutes les polices installées sont affichées dans la liste ci-dessus. Sinon, affiche uniquement la liste des polices à espacement fixe. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Créer une apparence - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Créez une apparence sans focus pour ce profil. Il s’agit de l’apparence du profil lorsqu’il est inactif. - A description for what the create unfocused appearance button does. - Supprimer une apparence Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw index 2e59cbd3ac..f7a3cb08f2 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw @@ -1241,10 +1241,6 @@ Aspetto con stato non attivo The header for the section where the unfocused appearance settings can be changed. - - Crea aspetto - Button label that adds an unfocused appearance for this profile. - Elimina Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Se abilitata, mostra tutti i tipi di carattere installati nell'elenco precedente. In caso contrario, visualizza solo l'elenco dei tipi di carattere a spaziatura fissa. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Crea aspetto - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Crea un aspetto non attivo per questo profilo. Questo sarà l'aspetto del profilo quando è inattivo. - A description for what the create unfocused appearance button does. - Elimina aspetto Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw index 46e41b68f4..02379869ff 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw @@ -1241,10 +1241,6 @@ フォーカスされていない外観 The header for the section where the unfocused appearance settings can be changed. - - 外観の作成 - Button label that adds an unfocused appearance for this profile. - 削除 Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ 有効にすると、上の一覧にあるインストールされたすべてのフォントが表示されます。無効の場合は、等幅フォントの一覧のみが表示されます。 A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - 外観の作成 - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - このプロファイルのフォーカスされていない外観を作成します。これは、プロファイルが非アクティブな場合の外観になります。 - A description for what the create unfocused appearance button does. - 外観の削除 Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw index a48378de39..a094309260 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw @@ -1241,10 +1241,6 @@ 포커스되지 않는 모양 The header for the section where the unfocused appearance settings can be changed. - - 모양 만들기 - Button label that adds an unfocused appearance for this profile. - 삭제 Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ 사용하도록 설정된 경우 위의 목록에 설치된 모든 글꼴을 표시합니다. 그렇지 않으면 고정 폭 글꼴 목록만 표시합니다. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - 모양 만들기 - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - 이 프로필에 대해 할당되지 않은 모양을 만듭니다. 프로필이 비활성 상태인 경우 프로필의 모양이 됩니다. - A description for what the create unfocused appearance button does. - 모양 삭제 Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw index 76595ce219..e8f9dbf7d6 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw @@ -1241,10 +1241,6 @@ Aparência sem foco The header for the section where the unfocused appearance settings can be changed. - - Criar Aparência - Button label that adds an unfocused appearance for this profile. - Excluir Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Se ativado, mostra todas as fontes instaladas na lista acima. Caso contrário, mostra apenas as fontes monoespaçadas. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Criar Aparência - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Crie uma aparência sem foco para este perfil. Esta será a aparência do perfil quando ele estiver inativo. - A description for what the create unfocused appearance button does. - Excluir Aparência Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw index d9f2ea53c4..940ce69d16 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw @@ -1241,10 +1241,6 @@ Ûηƒŏċμşεď äррėāŕαńćё !!! !!! The header for the section where the unfocused appearance settings can be changed. - - Ĉřêάŧэ Δрφзάŕãñςε !!! !! - Button label that adds an unfocused appearance for this profile. - Ðéľėŧê ! Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Įƒ ěлåвℓεď, šħöω ăℓŀ їήšτаļľêð ƒõņŧŝ ίл τне ľíşť ªвσνє. Öťĥέŕωíŝě, ôπľγ ŝĥσẃ ţĥэ ľíѕτ θƒ mōйǿѕφâčз ƒоņτŝ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! ! A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Çřëаţë Ăφрзαѓăʼn¢έ !!! !! - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Ċґêâŧέ āл ûηƒοćüšεð аφрěąґªŋčέ ƒòř тнìş φřòƒîľέ. Ţнīѕ ωïĺľ вé ťнē αррêãřªήç℮ οƒ ŧћê ρґőƒίļė ŵħėņ īŧ ίš ïńαčτîν℮. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! - A description for what the create unfocused appearance button does. - Ďєľéтę Āρρєαяâп¢ė !!! !! Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw index d9f2ea53c4..940ce69d16 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw @@ -1241,10 +1241,6 @@ Ûηƒŏċμşεď äррėāŕαńćё !!! !!! The header for the section where the unfocused appearance settings can be changed. - - Ĉřêάŧэ Δрφзάŕãñςε !!! !! - Button label that adds an unfocused appearance for this profile. - Ðéľėŧê ! Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Įƒ ěлåвℓεď, šħöω ăℓŀ їήšτаļľêð ƒõņŧŝ ίл τне ľíşť ªвσνє. Öťĥέŕωíŝě, ôπľγ ŝĥσẃ ţĥэ ľíѕτ θƒ mōйǿѕφâčз ƒоņτŝ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! ! A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Çřëаţë Ăφрзαѓăʼn¢έ !!! !! - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Ċґêâŧέ āл ûηƒοćüšεð аφрěąґªŋčέ ƒòř тнìş φřòƒîľέ. Ţнīѕ ωïĺľ вé ťнē αррêãřªήç℮ οƒ ŧћê ρґőƒίļė ŵħėņ īŧ ίš ïńαčτîν℮. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! - A description for what the create unfocused appearance button does. - Ďєľéтę Āρρєαяâп¢ė !!! !! Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw index d9f2ea53c4..940ce69d16 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw @@ -1241,10 +1241,6 @@ Ûηƒŏċμşεď äррėāŕαńćё !!! !!! The header for the section where the unfocused appearance settings can be changed. - - Ĉřêάŧэ Δрφзάŕãñςε !!! !! - Button label that adds an unfocused appearance for this profile. - Ðéľėŧê ! Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Įƒ ěлåвℓεď, šħöω ăℓŀ їήšτаļľêð ƒõņŧŝ ίл τне ľíşť ªвσνє. Öťĥέŕωíŝě, ôπľγ ŝĥσẃ ţĥэ ľíѕτ θƒ mōйǿѕφâčз ƒоņτŝ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! ! A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Çřëаţë Ăφрзαѓăʼn¢έ !!! !! - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Ċґêâŧέ āл ûηƒοćüšεð аφрěąґªŋčέ ƒòř тнìş φřòƒîľέ. Ţнīѕ ωïĺľ вé ťнē αррêãřªήç℮ οƒ ŧћê ρґőƒίļė ŵħėņ īŧ ίš ïńαčτîν℮. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! - A description for what the create unfocused appearance button does. - Ďєľéтę Āρρєαяâп¢ė !!! !! Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw index a23ab4bd3e..70e4bde815 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw @@ -1241,10 +1241,6 @@ Внешний вид без фокуса The header for the section where the unfocused appearance settings can be changed. - - Создать внешний вид - Button label that adds an unfocused appearance for this profile. - Удалить Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ Если этот параметр включен, отобразятся все установленные шрифты в приведенном выше списке. В противном случае будет показан только список моноширинных шрифтов. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Создать внешний вид - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Добавление настроек внешнего вида профиля, когда он не используется. Эти параметры будут применяться к профилю, когда он не активен. - A description for what the create unfocused appearance button does. - Удалить внешний вид Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw index dd4eef19d4..f0de2a8465 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw @@ -1206,10 +1206,6 @@ Изглед ван фокуса The header for the section where the unfocused appearance settings can be changed. - - Креирај изглед - Button label that adds an unfocused appearance for this profile. - Обриши Button label that deletes the unfocused appearance for this profile. @@ -1702,14 +1698,6 @@ Ако је укључено, горња листа приказује све инсталиране фонтове. У супротном, приказује се само листа фонтова фиксне ширине. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Креирај изглед - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Креира за овај профил изглед када није у фокусу. То ће бити изглед профила када није активан. - A description for what the create unfocused appearance button does. - Обриши изглед Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw index 85ed3d4b04..2ef162626b 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw @@ -1241,10 +1241,6 @@ Зовнішній вигляд несфокусованого вікна The header for the section where the unfocused appearance settings can be changed. - - Створення зовнішнього вигляду - Button label that adds an unfocused appearance for this profile. - Видалити Button label that deletes the unfocused appearance for this profile. @@ -1768,14 +1764,6 @@ Якщо ввімкнено, показувати всі встановлені шрифти у списку вище. В іншому випадку відобразити лише список моноширинних шрифтів. A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - Створення зовнішнього вигляду - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - Створити вигляд для цього профілю коли він не фокусі. Так виглядатиме профіль, коли він неактивний. - A description for what the create unfocused appearance button does. - Видалити зовнішній вигляд Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw index 1edd188820..500c91a7eb 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw @@ -1241,10 +1241,6 @@ 无焦点外观 The header for the section where the unfocused appearance settings can be changed. - - 创建外观 - Button label that adds an unfocused appearance for this profile. - 删除 Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ 如果启用,则在上面的列表中显示所有已安装的字体。否则,仅显示等宽字体列表。 A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - 创建外观 - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - 创建此配置文件的无焦点外观。这将是配置文件处于非活动状态时的外观。 - A description for what the create unfocused appearance button does. - 删除外观 Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw index 52ea07f1c9..576dc53037 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw @@ -1241,10 +1241,6 @@ 非焦點外觀 The header for the section where the unfocused appearance settings can be changed. - - 建立外觀 - Button label that adds an unfocused appearance for this profile. - 刪除 Button label that deletes the unfocused appearance for this profile. @@ -1741,14 +1737,6 @@ 如果啟用,顯示上述清單中所有已安裝的字型。否則,僅顯示等寬字型清單。 A description for what the supplementary "show all fonts" setting does. Presented near "Profile_FontFaceShowAllFonts". - - 建立外觀 - Name for a control which creates the unfocused appearance settings for this profile. Text must match that of "Profile_AddAppearanceButton.Text". - - - 立此設定檔的非焦點外觀。這會是設定檔處於非使用中狀態時的外觀。 - A description for what the create unfocused appearance button does. - 刪除外觀 Name for a control which deletes the unfocused appearance settings for this profile. diff --git a/tools/GenerateSettingsIndex.ps1 b/tools/GenerateSettingsIndex.ps1 index 5ef096c20a..e106e92fdf 100644 --- a/tools/GenerateSettingsIndex.ps1 +++ b/tools/GenerateSettingsIndex.ps1 @@ -25,7 +25,8 @@ $ProhibitedUids = @( "ColorScheme_ColorsHeader", "ColorScheme_Rename", "Profile_ResetProfile", - "Profile_DeleteProfile" + "Profile_DeleteProfile", + "Profile_DeleteUnfocusedAppearance" ) # Prohibited XAML files (already limited to Page root elements) @@ -93,6 +94,11 @@ $ClassMap = @{ NavigationParam = "GlobalProfile_Nav" SubPage = "BreadcrumbSubPage::Profile_Appearance" } + "Microsoft::Terminal::Settings::Editor::Profiles_UnfocusedAppearance" = @{ + ResourceName = "Nav_ProfileDefaults/Content" + NavigationParam = "GlobalProfile_Nav" + SubPage = "BreadcrumbSubPage::Profile_UnfocusedAppearance" + } "Microsoft::Terminal::Settings::Editor::Profiles_Terminal" = @{ ResourceName = "Nav_ProfileDefaults/Content" NavigationParam = "GlobalProfile_Nav" @@ -113,6 +119,7 @@ $ClassMap = @{ function IsProfileSubPage($pageClass) { return $pageClass -match "Editor::Profiles_Appearance" -or + $pageClass -match "Editor::Profiles_UnfocusedAppearance" -or $pageClass -match "Editor::Profiles_Terminal" -or $pageClass -match "Editor::Profiles_Advanced" } @@ -200,9 +207,10 @@ foreach ($xamlFile in Get-ChildItem -Path $SourceDir -Filter *.xaml) # - no UID because we want to reuse existing resources to reduce localization burden # - when selected, we want to navigate to the subpage (not focus the navigator) $navigators = @( - @{ Resource = "Profile_Appearance/Header"; SubPage = "BreadcrumbSubPage::Profile_Appearance" } - @{ Resource = "Profile_Terminal/Header"; SubPage = "BreadcrumbSubPage::Profile_Terminal" } - @{ Resource = "Profile_Advanced/Header"; SubPage = "BreadcrumbSubPage::Profile_Advanced" } + @{ Resource = "Profile_Appearance/Header"; SubPage = "BreadcrumbSubPage::Profile_Appearance" } + @{ Resource = "Profile_UnfocusedAppearanceTextBlock/Text"; SubPage = "BreadcrumbSubPage::Profile_UnfocusedAppearance" } + @{ Resource = "Profile_Terminal/Header"; SubPage = "BreadcrumbSubPage::Profile_Terminal" } + @{ Resource = "Profile_Advanced/Header"; SubPage = "BreadcrumbSubPage::Profile_Advanced" } ) foreach ($nav in $navigators) {