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 13 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
90 changes: 42 additions & 48 deletions src/cascadia/TerminalApp/TerminalSettings.h
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
Expand Up @@ -273,6 +273,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
Expand Up @@ -77,6 +77,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
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsEditor/Profiles.idl
Expand Up @@ -18,9 +18,9 @@ namespace Microsoft.Terminal.Settings.Editor
Boolean BackgroundImageSettingsVisible { get; };

OBSERVABLE_PROJECTED_SETTING(String, Name);
OBSERVABLE_PROJECTED_SETTING(Guid, Guid);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid);
OBSERVABLE_PROJECTED_SETTING(String, Source);
OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType);
OBSERVABLE_PROJECTED_SETTING(Boolean, Hidden);
OBSERVABLE_PROJECTED_SETTING(String, Icon);
OBSERVABLE_PROJECTED_SETTING(Microsoft.Terminal.Settings.Model.CloseOnExitMode, CloseOnExit);
Expand Down