-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Add a Compatibility and Terminal page to the Settings UI #17895
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8a34341
Add a Compatibility page to the Settings UI
carlos-zamora b7569e0
experimental.input.forceVT -> compatibility.input.forceVT
carlos-zamora b153672
Add compatibility.allowVtChecksumReport global setting
carlos-zamora d609f14
Add compatibility.allowKeypadMode global setting
carlos-zamora 47cd42d
Add a few more compatibility settings to SUI
carlos-zamora 60ac05f
update schema
carlos-zamora 44f0e79
fix build
carlos-zamora 92b0bf1
spell
carlos-zamora 1dc0714
audit mode
carlos-zamora 55533d1
fix tests
carlos-zamora 7123a37
move 'textMeasurement' to compat page
carlos-zamora 302e072
remove feature flag
carlos-zamora 90d8fa1
add debugFeatures too
carlos-zamora bc84a4c
apply feedback; create Profile>Terminal page
carlos-zamora cb661bc
apply feedback
carlos-zamora bb1521b
missed one
carlos-zamora c694620
update schema
carlos-zamora 053477d
Merge branch 'main' into dev/cazamor/sui/compatibility-0age
carlos-zamora a47a703
whoops
carlos-zamora 62fbfc8
Merge branch 'main' into dev/cazamor/sui/compatibility-0age
carlos-zamora fcdaa17
fix test; add AnswerbackMessage setting
carlos-zamora 64454b4
remove DECKPAM setting; fix bad merge
carlos-zamora 89e3ba9
Merge branch 'main' into dev/cazamor/sui/compatibility-0age
carlos-zamora 256a711
apply feedback
carlos-zamora b0952b8
Merge branch 'main' into dev/cazamor/sui/compatibility-0age
carlos-zamora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| #include "pch.h" | ||
| #include "Compatibility.h" | ||
| #include "EnumEntry.h" | ||
| #include "Compatibility.g.cpp" | ||
| #include "CompatibilityViewModel.g.cpp" | ||
|
|
||
| using namespace winrt::Windows::UI::Xaml::Navigation; | ||
| using namespace winrt::Microsoft::Terminal::Settings::Model; | ||
|
|
||
| namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | ||
| { | ||
| CompatibilityViewModel::CompatibilityViewModel(Model::GlobalAppSettings globalSettings) : | ||
| _GlobalSettings{ globalSettings } | ||
| { | ||
| INITIALIZE_BINDABLE_ENUM_SETTING(TextMeasurement, TextMeasurement, winrt::Microsoft::Terminal::Control::TextMeasurement, L"Globals_TextMeasurement_", L"Text"); | ||
| } | ||
|
|
||
| bool CompatibilityViewModel::DebugFeaturesAvailable() const noexcept | ||
| { | ||
| return Feature_DebugMode::IsEnabled(); | ||
| } | ||
|
|
||
| Compatibility::Compatibility() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| void Compatibility::OnNavigatedTo(const NavigationEventArgs& e) | ||
| { | ||
| _ViewModel = e.Parameter().as<Editor::CompatibilityViewModel>(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "Compatibility.g.h" | ||
| #include "CompatibilityViewModel.g.h" | ||
| #include "ViewModelHelpers.h" | ||
| #include "Utils.h" | ||
|
|
||
| namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | ||
| { | ||
| struct CompatibilityViewModel : CompatibilityViewModelT<CompatibilityViewModel>, ViewModelHelper<CompatibilityViewModel> | ||
| { | ||
| public: | ||
| CompatibilityViewModel(Model::GlobalAppSettings globalSettings); | ||
|
|
||
| bool DebugFeaturesAvailable() const noexcept; | ||
|
|
||
| // DON'T YOU DARE ADD A `WINRT_CALLBACK(PropertyChanged` TO A CLASS DERIVED FROM ViewModelHelper. Do this instead: | ||
| using ViewModelHelper<CompatibilityViewModel>::PropertyChanged; | ||
|
|
||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, AllowHeadless); | ||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, IsolatedMode); | ||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, DebugFeaturesEnabled); | ||
| GETSET_BINDABLE_ENUM_SETTING(TextMeasurement, winrt::Microsoft::Terminal::Control::TextMeasurement, _GlobalSettings.TextMeasurement); | ||
|
|
||
| private: | ||
| Model::GlobalAppSettings _GlobalSettings; | ||
| }; | ||
|
|
||
| struct Compatibility : public HasScrollViewer<Compatibility>, CompatibilityT<Compatibility> | ||
| { | ||
| Compatibility(); | ||
|
|
||
| void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e); | ||
|
|
||
| til::property_changed_event PropertyChanged; | ||
| WINRT_OBSERVABLE_PROPERTY(Editor::CompatibilityViewModel, ViewModel, PropertyChanged.raise, nullptr); | ||
| }; | ||
| } | ||
|
|
||
| namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation | ||
| { | ||
| BASIC_FACTORY(Compatibility); | ||
| BASIC_FACTORY(CompatibilityViewModel); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| import "EnumEntry.idl"; | ||
|
|
||
| #include "ViewModelHelpers.idl.h" | ||
|
|
||
| namespace Microsoft.Terminal.Settings.Editor | ||
| { | ||
| runtimeclass CompatibilityViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged | ||
| { | ||
| CompatibilityViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); | ||
|
|
||
| Boolean DebugFeaturesAvailable { get; }; | ||
|
|
||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AllowHeadless); | ||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, IsolatedMode); | ||
| PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, DebugFeaturesEnabled); | ||
|
|
||
| IInspectable CurrentTextMeasurement; | ||
| Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> TextMeasurementList { get; }; | ||
| } | ||
|
|
||
| [default_interface] runtimeclass Compatibility : Windows.UI.Xaml.Controls.Page | ||
| { | ||
| Compatibility(); | ||
| CompatibilityViewModel ViewModel { get; }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <!-- | ||
| Copyright (c) Microsoft Corporation. All rights reserved. Licensed under | ||
| the MIT License. See LICENSE in the project root for license information. | ||
| --> | ||
| <Page x:Class="Microsoft.Terminal.Settings.Editor.Compatibility" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:local="using:Microsoft.Terminal.Settings.Editor" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:muxc="using:Microsoft.UI.Xaml.Controls" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Page.Resources> | ||
| <ResourceDictionary> | ||
| <ResourceDictionary.MergedDictionaries> | ||
| <ResourceDictionary Source="CommonResources.xaml" /> | ||
| </ResourceDictionary.MergedDictionaries> | ||
|
|
||
| <DataTemplate x:Key="EnumComboBoxTemplate" | ||
| x:DataType="local:EnumEntry"> | ||
| <TextBlock Text="{x:Bind EnumName}" /> | ||
| </DataTemplate> | ||
| </ResourceDictionary> | ||
| </Page.Resources> | ||
|
|
||
| <StackPanel Style="{StaticResource SettingsStackStyle}"> | ||
| <!-- Allow Headless --> | ||
| <local:SettingContainer x:Uid="Globals_AllowHeadless"> | ||
| <ToggleSwitch IsOn="{x:Bind ViewModel.AllowHeadless, Mode=TwoWay}" | ||
| Style="{StaticResource ToggleSwitchInExpanderStyle}" /> | ||
| </local:SettingContainer> | ||
|
|
||
| <!-- Isolated Mode --> | ||
| <local:SettingContainer x:Uid="Globals_IsolatedMode"> | ||
| <ToggleSwitch IsOn="{x:Bind ViewModel.IsolatedMode, Mode=TwoWay}" | ||
| Style="{StaticResource ToggleSwitchInExpanderStyle}" /> | ||
| </local:SettingContainer> | ||
|
|
||
| <!-- Text Measurement --> | ||
| <local:SettingContainer x:Uid="Globals_TextMeasurement"> | ||
| <ComboBox AutomationProperties.AccessibilityView="Content" | ||
| ItemTemplate="{StaticResource EnumComboBoxTemplate}" | ||
| ItemsSource="{x:Bind ViewModel.TextMeasurementList}" | ||
| SelectedItem="{x:Bind ViewModel.CurrentTextMeasurement, Mode=TwoWay}" | ||
| Style="{StaticResource ComboBoxSettingStyle}" /> | ||
| </local:SettingContainer> | ||
|
|
||
| <!-- Debug Features --> | ||
| <local:SettingContainer x:Uid="Globals_DebugFeaturesEnabled" | ||
| Visibility="{x:Bind ViewModel.DebugFeaturesAvailable}"> | ||
| <ToggleSwitch IsOn="{x:Bind ViewModel.DebugFeaturesEnabled, Mode=TwoWay}" | ||
| Style="{StaticResource ToggleSwitchInExpanderStyle}" | ||
| Visibility="{x:Bind ViewModel.DebugFeaturesEnabled}" /> | ||
carlos-zamora marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </local:SettingContainer> | ||
| </StackPanel> | ||
| </Page> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.