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

Introduce setting override tracking and update SettingContainer #9079

Merged
22 commits merged into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dd764a8
TSM: add getter for source object
carlos-zamora Feb 8, 2021
4c2f59a
TSM: implement tagging mechanism for profiles
carlos-zamora Feb 8, 2021
309746b
fix TSM
carlos-zamora Feb 9, 2021
576a3f0
TSE: implement message generation
carlos-zamora Feb 9, 2021
64c776e
working prototype
carlos-zamora Feb 9, 2021
ac9b549
polish; ready for review
carlos-zamora Feb 9, 2021
4f3ca9a
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 9, 2021
a99afb6
fix build; update TerminalSettings
carlos-zamora Feb 9, 2021
1ba476e
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 9, 2021
08e1050
code format
carlos-zamora Feb 9, 2021
40d8742
redesign: remove text; update reset btn
carlos-zamora Feb 16, 2021
f8c4081
PROJECTED_SETTING --> INHERITABLE_SETTING
carlos-zamora Feb 17, 2021
500c38e
polish more now that we don't need hyperlinks
carlos-zamora Feb 17, 2021
73e708d
address PR feedback
carlos-zamora Feb 19, 2021
5e02669
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
db21da6
tag proto-extension profiles as generated
carlos-zamora Feb 19, 2021
f49cdbf
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
7e094c6
include the reset button when we're overriding proto-extension
carlos-zamora Feb 19, 2021
9edceb2
introduce fragment origin tag
carlos-zamora Feb 19, 2021
f1cd288
Prefer {} construction
carlos-zamora Feb 19, 2021
f1a8b35
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
f396b16
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 42 additions & 48 deletions src/cascadia/TerminalApp/TerminalSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ namespace winrt::TerminalApp::implementation
void ColorTable(std::array<uint32_t, 16> colors);
std::array<uint32_t, 16> ColorTable();

GETSET_SETTING(uint32_t, DefaultForeground, DEFAULT_FOREGROUND_WITH_ALPHA);
GETSET_SETTING(uint32_t, DefaultBackground, DEFAULT_BACKGROUND_WITH_ALPHA);
GETSET_SETTING(uint32_t, SelectionBackground, DEFAULT_FOREGROUND);
GETSET_SETTING(int32_t, HistorySize, DEFAULT_HISTORY_SIZE);
GETSET_SETTING(int32_t, InitialRows, 30);
GETSET_SETTING(int32_t, InitialCols, 80);

GETSET_SETTING(bool, SnapOnInput, true);
GETSET_SETTING(bool, AltGrAliasing, true);
GETSET_SETTING(uint32_t, CursorColor, DEFAULT_CURSOR_COLOR);
GETSET_SETTING(Microsoft::Terminal::TerminalControl::CursorStyle, CursorShape, Microsoft::Terminal::TerminalControl::CursorStyle::Vintage);
GETSET_SETTING(uint32_t, CursorHeight, DEFAULT_CURSOR_HEIGHT);
GETSET_SETTING(hstring, WordDelimiters, DEFAULT_WORD_DELIMITERS);
GETSET_SETTING(bool, CopyOnSelect, false);
GETSET_SETTING(bool, FocusFollowMouse, false);

GETSET_SETTING(Windows::Foundation::IReference<uint32_t>, TabColor, nullptr);
GETSET_SETTING(TerminalApp::TerminalSettings, uint32_t, DefaultForeground, DEFAULT_FOREGROUND_WITH_ALPHA);
GETSET_SETTING(TerminalApp::TerminalSettings, uint32_t, DefaultBackground, DEFAULT_BACKGROUND_WITH_ALPHA);
GETSET_SETTING(TerminalApp::TerminalSettings, uint32_t, SelectionBackground, DEFAULT_FOREGROUND);
GETSET_SETTING(TerminalApp::TerminalSettings, int32_t, HistorySize, DEFAULT_HISTORY_SIZE);
GETSET_SETTING(TerminalApp::TerminalSettings, int32_t, InitialRows, 30);
GETSET_SETTING(TerminalApp::TerminalSettings, int32_t, InitialCols, 80);

GETSET_SETTING(TerminalApp::TerminalSettings, bool, SnapOnInput, true);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, AltGrAliasing, true);
GETSET_SETTING(TerminalApp::TerminalSettings, uint32_t, CursorColor, DEFAULT_CURSOR_COLOR);
GETSET_SETTING(TerminalApp::TerminalSettings, Microsoft::Terminal::TerminalControl::CursorStyle, CursorShape, Microsoft::Terminal::TerminalControl::CursorStyle::Vintage);
GETSET_SETTING(TerminalApp::TerminalSettings, uint32_t, CursorHeight, DEFAULT_CURSOR_HEIGHT);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, WordDelimiters, DEFAULT_WORD_DELIMITERS);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, CopyOnSelect, false);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, FocusFollowMouse, false);

GETSET_SETTING(TerminalApp::TerminalSettings, Windows::Foundation::IReference<uint32_t>, TabColor, nullptr);

// When set, StartingTabColor allows to create a terminal with a "sticky" tab color.
// This color is prioritized above the TabColor (that is usually initialized based on profile settings).
Expand All @@ -76,48 +76,42 @@ namespace winrt::TerminalApp::implementation
// TODO: to ensure that this property is not populated during settings reload,
// we should consider moving this property to a separate interface,
// passed to the terminal only upon creation.
GETSET_SETTING(Windows::Foundation::IReference<uint32_t>, StartingTabColor, nullptr);
GETSET_SETTING(TerminalApp::TerminalSettings, Windows::Foundation::IReference<uint32_t>, StartingTabColor, nullptr);

// ------------------------ End of Core Settings -----------------------

GETSET_SETTING(hstring, ProfileName);
GETSET_SETTING(bool, UseAcrylic, false);
GETSET_SETTING(double, TintOpacity, 0.5);
GETSET_SETTING(hstring, Padding, DEFAULT_PADDING);
GETSET_SETTING(hstring, FontFace, DEFAULT_FONT_FACE);
GETSET_SETTING(int32_t, FontSize, DEFAULT_FONT_SIZE);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, ProfileName);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, UseAcrylic, false);
GETSET_SETTING(TerminalApp::TerminalSettings, double, TintOpacity, 0.5);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, Padding, DEFAULT_PADDING);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, FontFace, DEFAULT_FONT_FACE);
GETSET_SETTING(TerminalApp::TerminalSettings, int32_t, FontSize, DEFAULT_FONT_SIZE);

GETSET_SETTING(winrt::Windows::UI::Text::FontWeight, FontWeight);
GETSET_SETTING(TerminalApp::TerminalSettings, winrt::Windows::UI::Text::FontWeight, FontWeight);

GETSET_SETTING(hstring, BackgroundImage);
GETSET_SETTING(double, BackgroundImageOpacity, 1.0);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, BackgroundImage);
GETSET_SETTING(TerminalApp::TerminalSettings, double, BackgroundImageOpacity, 1.0);

GETSET_SETTING(winrt::Windows::UI::Xaml::Media::Stretch,
BackgroundImageStretchMode,
winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill);
GETSET_SETTING(winrt::Windows::UI::Xaml::HorizontalAlignment,
BackgroundImageHorizontalAlignment,
winrt::Windows::UI::Xaml::HorizontalAlignment::Center);
GETSET_SETTING(winrt::Windows::UI::Xaml::VerticalAlignment,
BackgroundImageVerticalAlignment,
winrt::Windows::UI::Xaml::VerticalAlignment::Center);
GETSET_SETTING(TerminalApp::TerminalSettings, winrt::Windows::UI::Xaml::Media::Stretch, BackgroundImageStretchMode, winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill);
GETSET_SETTING(TerminalApp::TerminalSettings, winrt::Windows::UI::Xaml::HorizontalAlignment, BackgroundImageHorizontalAlignment, winrt::Windows::UI::Xaml::HorizontalAlignment::Center);
GETSET_SETTING(TerminalApp::TerminalSettings, winrt::Windows::UI::Xaml::VerticalAlignment, BackgroundImageVerticalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment::Center);

GETSET_SETTING(Microsoft::Terminal::TerminalControl::IKeyBindings, KeyBindings, nullptr);
GETSET_SETTING(TerminalApp::TerminalSettings, Microsoft::Terminal::TerminalControl::IKeyBindings, KeyBindings, nullptr);

GETSET_SETTING(hstring, Commandline);
GETSET_SETTING(hstring, StartingDirectory);
GETSET_SETTING(hstring, StartingTitle);
GETSET_SETTING(bool, SuppressApplicationTitle);
GETSET_SETTING(hstring, EnvironmentVariables);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, Commandline);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, StartingDirectory);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, StartingTitle);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, SuppressApplicationTitle);
GETSET_SETTING(TerminalApp::TerminalSettings, hstring, EnvironmentVariables);

GETSET_SETTING(Microsoft::Terminal::TerminalControl::ScrollbarState, ScrollState, Microsoft::Terminal::TerminalControl::ScrollbarState::Visible);
GETSET_SETTING(TerminalApp::TerminalSettings, Microsoft::Terminal::TerminalControl::ScrollbarState, ScrollState, Microsoft::Terminal::TerminalControl::ScrollbarState::Visible);

GETSET_SETTING(Microsoft::Terminal::TerminalControl::TextAntialiasingMode, AntialiasingMode, Microsoft::Terminal::TerminalControl::TextAntialiasingMode::Grayscale);
GETSET_SETTING(TerminalApp::TerminalSettings, Microsoft::Terminal::TerminalControl::TextAntialiasingMode, AntialiasingMode, Microsoft::Terminal::TerminalControl::TextAntialiasingMode::Grayscale);

GETSET_SETTING(bool, RetroTerminalEffect, false);
GETSET_SETTING(bool, ForceFullRepaintRendering, false);
GETSET_SETTING(bool, SoftwareRendering, false);
GETSET_SETTING(bool, ForceVTInput, false);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, RetroTerminalEffect, false);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, ForceFullRepaintRendering, false);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, SoftwareRendering, false);
GETSET_SETTING(TerminalApp::TerminalSettings, bool, ForceVTInput, false);

GETSET_PROPERTY(hstring, PixelShaderPath);

Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalSettingsEditor/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
}
}

// Method Description:
// - updates the content frame to present a view of the profile page
// - NOTE: this does not update the selected item.
// Arguments:
// - profile - the profile object we are getting a view of
void MainPage::_Navigate(const Editor::ProfileViewModel& profile)
{
_lastProfilesNavState = winrt::make<ProfilePageNavigationState>(profile,
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsEditor/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ the MIT License. See LICENSE in the project root for license information. -->
<muxc:NavigationViewItemHeader x:Uid="Nav_Profiles"/>

<muxc:NavigationViewItem x:Uid="Nav_ProfileDefaults"
x:Name="BaseLayerMenuItem"
Tag="GlobalProfile_Nav">
<muxc:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE81E;"/>
Expand Down
80 changes: 42 additions & 38 deletions src/cascadia/TerminalSettingsEditor/Profiles.idl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import "MainPage.idl";

#include "ViewModelHelpers.idl.h"

#define OBSERVABLE_PROJECTED_PROFILE_SETTING(Type, Name) \
OBSERVABLE_PROJECTED_SETTING(Type, Name); \
Microsoft.Terminal.Settings.Model.Profile Name##OverrideSource { get; }

namespace Microsoft.Terminal.Settings.Editor
{
runtimeclass ProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
Expand All @@ -17,44 +21,44 @@ namespace Microsoft.Terminal.Settings.Editor
Boolean UseCustomStartingDirectory { get; };
Boolean BackgroundImageSettingsVisible { get; };

OBSERVABLE_PROJECTED_SETTING(String, Name);
OBSERVABLE_PROJECTED_SETTING(Guid, Guid);
OBSERVABLE_PROJECTED_SETTING(String, Source);
OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType);
OBSERVABLE_PROJECTED_SETTING(Boolean, Hidden);
OBSERVABLE_PROJECTED_SETTING(String, Icon);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.Settings.Model.CloseOnExitMode, CloseOnExit);
OBSERVABLE_PROJECTED_SETTING(String, TabTitle);
OBSERVABLE_PROJECTED_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, TabColor);
OBSERVABLE_PROJECTED_SETTING(Boolean, SuppressApplicationTitle);
OBSERVABLE_PROJECTED_SETTING(Boolean, UseAcrylic);
OBSERVABLE_PROJECTED_SETTING(Double, AcrylicOpacity);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.TerminalControl.ScrollbarState, ScrollState);
OBSERVABLE_PROJECTED_SETTING(String, FontFace);
OBSERVABLE_PROJECTED_SETTING(Int32, FontSize);
OBSERVABLE_PROJECTED_SETTING(Windows.UI.Text.FontWeight, FontWeight);
OBSERVABLE_PROJECTED_SETTING(String, Padding);
OBSERVABLE_PROJECTED_SETTING(String, Commandline);
OBSERVABLE_PROJECTED_SETTING(String, StartingDirectory);
OBSERVABLE_PROJECTED_SETTING(String, BackgroundImagePath);
OBSERVABLE_PROJECTED_SETTING(Double, BackgroundImageOpacity);
OBSERVABLE_PROJECTED_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.Settings.Model.ConvergedAlignment, BackgroundImageAlignment);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.TerminalControl.TextAntialiasingMode, AntialiasingMode);
OBSERVABLE_PROJECTED_SETTING(Boolean, RetroTerminalEffect);
OBSERVABLE_PROJECTED_SETTING(Boolean, ForceFullRepaintRendering);
OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering);
OBSERVABLE_PROJECTED_SETTING(String, ColorSchemeName);
OBSERVABLE_PROJECTED_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, Foreground);
OBSERVABLE_PROJECTED_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, Background);
OBSERVABLE_PROJECTED_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, SelectionBackground);
OBSERVABLE_PROJECTED_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, CursorColor);
OBSERVABLE_PROJECTED_SETTING(Int32, HistorySize);
OBSERVABLE_PROJECTED_SETTING(Boolean, SnapOnInput);
OBSERVABLE_PROJECTED_SETTING(Boolean, AltGrAliasing);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.TerminalControl.CursorStyle, CursorShape);
OBSERVABLE_PROJECTED_SETTING(UInt32, CursorHeight);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.Settings.Model.BellStyle, BellStyle);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Name);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Source);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Hidden);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Icon);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.CloseOnExitMode, CloseOnExit);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, TabTitle);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, TabColor);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, UseAcrylic);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, AcrylicOpacity);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.TerminalControl.ScrollbarState, ScrollState);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, FontFace);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Int32, FontSize);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.UI.Text.FontWeight, FontWeight);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Padding);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Commandline);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, StartingDirectory);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, BackgroundImagePath);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, BackgroundImageOpacity);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.ConvergedAlignment, BackgroundImageAlignment);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.TerminalControl.TextAntialiasingMode, AntialiasingMode);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, RetroTerminalEffect);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ForceFullRepaintRendering);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SoftwareRendering);
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, ColorSchemeName);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, Foreground);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, Background);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, SelectionBackground);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Windows.UI.Color>, CursorColor);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Int32, HistorySize);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SnapOnInput);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, AltGrAliasing);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.TerminalControl.CursorStyle, CursorShape);
OBSERVABLE_PROJECTED_PROFILE_SETTING(UInt32, CursorHeight);
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.BellStyle, BellStyle);
}

runtimeclass DeleteProfileEventArgs
Expand Down
Loading