From efea1e5bad0f32f5457b3d49346001164e45e889 Mon Sep 17 00:00:00 2001 From: Leon Liang Date: Mon, 30 Aug 2021 18:39:03 -0700 Subject: [PATCH] Add Tray Icon settings to the SettingsUI (#11070) Adds toggle buttons to the settings UI for `minimizeToTray` and `alwaysShowTrayIcon` that I mistakenly left out. --- .../TerminalSettingsEditor/GlobalAppearance.cpp | 5 +++++ .../TerminalSettingsEditor/GlobalAppearance.h | 2 ++ .../TerminalSettingsEditor/GlobalAppearance.idl | 2 ++ .../TerminalSettingsEditor/GlobalAppearance.xaml | 12 ++++++++++++ .../Resources/en-US/Resources.resw | 8 ++++++++ 5 files changed, 29 insertions(+) diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp index d45c34e13..b97aea5ec 100644 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp +++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp @@ -198,4 +198,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation globals.Language(currentLanguage); } } + + bool GlobalAppearance::FeatureTrayIconEnabled() const noexcept + { + return Feature_TrayIcon::IsEnabled(); + } } diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.h b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.h index c566b953a..b8112d41a 100644 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.h +++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.h @@ -25,6 +25,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e); + bool FeatureTrayIconEnabled() const noexcept; + WINRT_PROPERTY(Editor::GlobalAppearancePageNavigationState, State, nullptr); GETSET_BINDABLE_ENUM_SETTING(Theme, winrt::Windows::UI::Xaml::ElementTheme, State().Globals, Theme); GETSET_BINDABLE_ENUM_SETTING(TabWidthMode, winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, State().Globals, TabWidthMode); diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl index 7e3483140..8218d3cad 100644 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl +++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl @@ -25,5 +25,7 @@ namespace Microsoft.Terminal.Settings.Editor IInspectable CurrentTabWidthMode; Windows.Foundation.Collections.IObservableVector TabWidthModeList { get; }; + + Boolean FeatureTrayIconEnabled { get; }; } } diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml index 5ecb1169f..68800bfb1 100644 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml +++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml @@ -84,6 +84,18 @@ + + + + + + + + + + diff --git a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw index 7b328dc4d..5edf5c577 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw @@ -1090,6 +1090,14 @@ Pane animations Header for a control to toggle animations on panes. "Enabled" value enables the animations. + + Always display an icon in the notification area + Header for a control to toggle whether the tray icon should always be shown. + + + Hide Terminal in the notification area when it is minimized + Header for a control to toggle whether the terminal should hide itself in the tray instead of the taskbar when minimized. + Reset to inherited value. This button will remove a user's customization from a given setting, restoring it to the value that the profile inherited. This is a text label on a button.