d57fb84557
This pull request brings back the "Base Layer" page, now renamed to "Defaults", and the "Reset to inherited value" buttons. The scope of inheritance for which buttons will display has been widened. The button will be visible in the following cases: The user has set a setting for the current profile, and it overrides... 1. ... something in profiles.defaults. 2. ... something in a Fragment Extension profile. 3. ... something from a Dynamic Profile Generator. 4. ... something from the compiled-in defaults. Compared to the original implementation of reset arrows, cases (1), (3) and (4) are new. Rationale: (1) The user can see a setting on the Defaults page, and they need a way to reset back to it. (3) Dynamic profiles are not meaningfully different from fragments, and users may need a way to reset back to the default value generated for WSL or PowerShell. (4) The user can see a setting on the Defaults page, **BUT** they are not the one who created it. They *still* need a way to get back to it. To support this, I've introduced another origin tag, "User", and renamed "Custom" to "None". Due to the way origin/override detection works¹, we cannot otherwise disambiguate between settings that came from the user and settings that came from the compiled-in defaults. Changes were required in TerminalSettings such that we could construct a settings object with a profile that does not have a GUID. In making this change, I fixed a bit of silliness where we took a profile, extracted its guid, and used that guid to look up the same profile object. Oops. I also fixed the PropertyChanged notifier to include the XxxOverrideSource property. The presence of the page and the reset arrows is restricted to Preview- or Dev-branded builds. Stable builds will retain their current behavior. ¹ `XxxOverrideSource` returns the profile *above* the current profile that holds a value for setting `Xxx`. When the value is the compiled-in value, `XxxOverrideSource` will be `null`. Since it's supposed to be the profile above the current profile, it will also be `null` if the profile contains a setting at this layer. In short, `null` means "user specified" *or* "compiled in". Oops. Fixes #10430 Validation ---------- * [x] Tested Release build to make sure it's mostly arrow-free (apart from fragments)
88 lines
2.9 KiB
Plaintext
88 lines
2.9 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
import "IAppearanceConfig.idl";
|
|
import "FontConfig.idl";
|
|
#include "IInheritable.idl.h"
|
|
|
|
#define INHERITABLE_PROFILE_SETTING(Type, Name) \
|
|
_BASE_INHERITABLE_SETTING(Type, Name); \
|
|
Microsoft.Terminal.Settings.Model.Profile Name##OverrideSource { get; }
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
// This tag is used to identify the context in which the Profile was created
|
|
enum OriginTag
|
|
{
|
|
None = 0,
|
|
User,
|
|
InBox,
|
|
Generated,
|
|
Fragment,
|
|
ProfilesDefaults
|
|
};
|
|
|
|
enum CloseOnExitMode
|
|
{
|
|
Never = 0,
|
|
Graceful,
|
|
Always
|
|
};
|
|
|
|
[flags]
|
|
enum BellStyle
|
|
{
|
|
// !! If you update this, you must update the values in TerminalSettingsEditor/Profiles.xaml
|
|
Audible = 0x1,
|
|
Window = 0x2,
|
|
Taskbar = 0x4,
|
|
All = 0xffffffff
|
|
};
|
|
|
|
[default_interface] runtimeclass Profile : Windows.Foundation.IStringable {
|
|
Profile();
|
|
Profile(Guid guid);
|
|
|
|
OriginTag Origin { get; };
|
|
|
|
INHERITABLE_PROFILE_SETTING(String, Name);
|
|
|
|
Boolean HasGuid();
|
|
Guid Guid;
|
|
|
|
INHERITABLE_PROFILE_SETTING(String, Source);
|
|
|
|
Boolean HasConnectionType();
|
|
Guid ConnectionType;
|
|
|
|
INHERITABLE_PROFILE_SETTING(Boolean, Hidden);
|
|
INHERITABLE_PROFILE_SETTING(String, Icon);
|
|
INHERITABLE_PROFILE_SETTING(CloseOnExitMode, CloseOnExit);
|
|
INHERITABLE_PROFILE_SETTING(String, TabTitle);
|
|
INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, UseAcrylic);
|
|
INHERITABLE_PROFILE_SETTING(Double, AcrylicOpacity);
|
|
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
|
INHERITABLE_PROFILE_SETTING(String, Padding);
|
|
INHERITABLE_PROFILE_SETTING(String, Commandline);
|
|
|
|
INHERITABLE_PROFILE_SETTING(String, StartingDirectory);
|
|
String EvaluatedStartingDirectory { get; };
|
|
|
|
FontConfig FontInfo { get; };
|
|
|
|
IAppearanceConfig DefaultAppearance { get; };
|
|
INHERITABLE_PROFILE_SETTING(IAppearanceConfig, UnfocusedAppearance);
|
|
|
|
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, ForceFullRepaintRendering);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, SoftwareRendering);
|
|
|
|
INHERITABLE_PROFILE_SETTING(Int32, HistorySize);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, SnapOnInput);
|
|
INHERITABLE_PROFILE_SETTING(Boolean, AltGrAliasing);
|
|
INHERITABLE_PROFILE_SETTING(BellStyle, BellStyle);
|
|
}
|
|
}
|