eb0fb3e822
This PR adds improved override message generation for inheritance in SUI. The settings model now has an `OriginTag` to be able to denote where a `Profile` came from. This tag is used in the `SettingContainer` to generate a more specific override message. ## References #6800 - SUI Epic #8919 - SUI Inheritance PR #8804 - SUI Inheritance (old issue) ## Detailed Description of the Pull Request / Additional comments - **Terminal Settings Model** - Introduced `PROJECTED_SETTING` as a macro to more easily declare the functions for each setting - Introduced `<setting>OverrideSource` which finds the `Profile` that has \<setting\> defined - Introduced `OriginTag Profile::Origin {Custom, InBox, Generated}` to trace where a profile came from - `DefaultProfileUtils` creates profiles for profile generators. So that now sets the `Origin` tag to `Generated` - `CascadiaSettings::LoadDefaults()` tags all profiles created as `InBox`. - The view model had to ingest the API change to be able to interact with `<setting>OverrideSource` - **Override Message Generation** - The reset button now has a more specific tooltip - The reset button now only appears if base layer is being overridden - We use the settings model changes to determine the message to display for the target ## Validation Steps Performed Tested the following cases: - overrides nothing (inherited setting) - overrides value inherited from... - base layer - a profile generator - in-box profile - global settings should not have this feature
25 lines
844 B
Plaintext
25 lines
844 B
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.Settings.Editor
|
|
{
|
|
[default_interface] runtimeclass SettingContainer : Windows.UI.Xaml.Controls.ContentControl
|
|
{
|
|
SettingContainer();
|
|
|
|
IInspectable Header;
|
|
static Windows.UI.Xaml.DependencyProperty HeaderProperty { get; };
|
|
|
|
String HelpText;
|
|
static Windows.UI.Xaml.DependencyProperty HelpTextProperty { get; };
|
|
|
|
Boolean HasSettingValue;
|
|
static Windows.UI.Xaml.DependencyProperty HasSettingValueProperty { get; };
|
|
|
|
IInspectable SettingOverrideSource;
|
|
static Windows.UI.Xaml.DependencyProperty SettingOverrideSourceProperty { get; };
|
|
|
|
event Windows.Foundation.TypedEventHandler<SettingContainer, Object> ClearSettingValue;
|
|
};
|
|
}
|