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
87 lines
3.1 KiB
Plaintext
87 lines
3.1 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#include "IInheritable.idl.h"
|
|
|
|
import "ColorScheme.idl";
|
|
import "KeyMapping.idl";
|
|
import "Command.idl";
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
// MIDL 3 allows for structs to hold nullable types
|
|
// Though IReference is a WinRT object, MIDL 3
|
|
// handles all of the ownership logic for us.
|
|
// Docs: https://docs.microsoft.com/en-us/uwp/midl-3/intro#types
|
|
struct LaunchPosition
|
|
{
|
|
Windows.Foundation.IReference<Int64> X;
|
|
Windows.Foundation.IReference<Int64> Y;
|
|
};
|
|
|
|
enum LaunchMode
|
|
{
|
|
DefaultMode,
|
|
MaximizedMode,
|
|
FullscreenMode,
|
|
FocusMode,
|
|
MaximizedFocusMode,
|
|
};
|
|
|
|
enum TabSwitcherMode
|
|
{
|
|
MostRecentlyUsed,
|
|
InOrder,
|
|
Disabled,
|
|
};
|
|
|
|
enum WindowingMode
|
|
{
|
|
UseNew,
|
|
UseAnyExisting,
|
|
UseExisting,
|
|
};
|
|
|
|
[default_interface] runtimeclass GlobalAppSettings {
|
|
Guid DefaultProfile;
|
|
INHERITABLE_SETTING(String, UnparsedDefaultProfile);
|
|
|
|
INHERITABLE_SETTING(Int32, InitialRows);
|
|
INHERITABLE_SETTING(Int32, InitialCols);
|
|
INHERITABLE_SETTING(Boolean, AlwaysShowTabs);
|
|
INHERITABLE_SETTING(Boolean, ShowTitleInTitlebar);
|
|
INHERITABLE_SETTING(Boolean, ConfirmCloseAllTabs);
|
|
INHERITABLE_SETTING(Windows.UI.Xaml.ElementTheme, Theme);
|
|
INHERITABLE_SETTING(Microsoft.UI.Xaml.Controls.TabViewWidthMode, TabWidthMode);
|
|
INHERITABLE_SETTING(Boolean, ShowTabsInTitlebar);
|
|
INHERITABLE_SETTING(String, WordDelimiters);
|
|
INHERITABLE_SETTING(Boolean, CopyOnSelect);
|
|
INHERITABLE_SETTING(Microsoft.Terminal.TerminalControl.CopyFormat, CopyFormatting);
|
|
INHERITABLE_SETTING(Boolean, WarnAboutLargePaste);
|
|
INHERITABLE_SETTING(Boolean, WarnAboutMultiLinePaste);
|
|
INHERITABLE_SETTING(LaunchPosition, InitialPosition);
|
|
INHERITABLE_SETTING(Boolean, CenterOnLaunch);
|
|
INHERITABLE_SETTING(LaunchMode, LaunchMode);
|
|
INHERITABLE_SETTING(Boolean, SnapToGridOnResize);
|
|
INHERITABLE_SETTING(Boolean, ForceFullRepaintRendering);
|
|
INHERITABLE_SETTING(Boolean, SoftwareRendering);
|
|
INHERITABLE_SETTING(Boolean, ForceVTInput);
|
|
INHERITABLE_SETTING(Boolean, DebugFeaturesEnabled);
|
|
INHERITABLE_SETTING(Boolean, StartOnUserLogin);
|
|
INHERITABLE_SETTING(Boolean, AlwaysOnTop);
|
|
INHERITABLE_SETTING(TabSwitcherMode, TabSwitcherMode);
|
|
INHERITABLE_SETTING(Boolean, DisableAnimations);
|
|
INHERITABLE_SETTING(String, StartupActions);
|
|
INHERITABLE_SETTING(Boolean, FocusFollowMouse);
|
|
INHERITABLE_SETTING(WindowingMode, WindowingBehavior);
|
|
|
|
Windows.Foundation.Collections.IMapView<String, ColorScheme> ColorSchemes();
|
|
void AddColorScheme(ColorScheme scheme);
|
|
void RemoveColorScheme(String schemeName);
|
|
|
|
KeyMapping KeyMap();
|
|
|
|
Windows.Foundation.Collections.IMapView<String, Command> Commands();
|
|
}
|
|
}
|