terminal/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl
Mike Griese 74f11b8203
Enable Vintage Opacity (#11180)
## Summary of the Pull Request
![603-final](https://user-images.githubusercontent.com/18356694/132585665-afed3210-257a-4fee-9b43-4273a0f5cf69.gif)

Adds support for vintage style opacity, on Windows 11+. The API we're using for this exists since the time immemorial, but there's a bug in XAML Islands that prevents it from working right until Windows 11 (which we're working on backporting).

Replaces the `acrylicOpacity` setting with `opacity`, which is a uint between 0 and 100 (inclusive), default to 100.

`useAcrylic` now controls whether acrylic is used or not. Setting an opacity < 100 with `"useAcrylic": false` will use vintage style opacity.

Mouse wheeling adjusts opacity. Whether acrylic is used or not is dependent upon `useAcrylic`.

`opacity` will stealthily default to 50 if `useAcrylic:true` is set.

## PR Checklist
* [x] Closes #603
* [x] I work here
* [x] Tests added/passed
* [x] https://github.com/MicrosoftDocs/terminal/pull/416

## Detailed Description of the Pull Request / Additional comments

Opacity was moved to AppearanceConfig. In the future, I have a mind to allow unfocused acrylic, so that'll be important then. 

## Validation Steps Performed
_just look at it_
2021-09-20 17:08:13 +00:00

57 lines
2.3 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "Profile.idl";
#include "IInheritable.idl.h"
#define INHERITABLE_APPEARANCE_SETTING(Type, Name) \
_BASE_INHERITABLE_SETTING(Type, Name); \
Microsoft.Terminal.Settings.Model.IAppearanceConfig Name##OverrideSource { get; }
namespace Microsoft.Terminal.Settings.Model
{
[flags] enum ConvergedAlignment {
// low 4 bits are the horizontal
Horizontal_Center = 0x00,
Horizontal_Left = 0x01,
Horizontal_Right = 0x02,
// high 4 bits are the vertical
Vertical_Center = 0x00,
Vertical_Top = 0x10,
Vertical_Bottom = 0x20
};
[flags]
enum IntenseStyle
{
Bold = 0x1,
Bright = 0x2,
All = 0xffffffff
};
interface IAppearanceConfig
{
Microsoft.Terminal.Settings.Model.Profile SourceProfile { get; };
INHERITABLE_APPEARANCE_SETTING(String, ColorSchemeName);
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, Foreground);
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, Background);
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, SelectionBackground);
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, CursorColor);
INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape);
INHERITABLE_APPEARANCE_SETTING(UInt32, CursorHeight);
INHERITABLE_APPEARANCE_SETTING(String, BackgroundImagePath);
String ExpandedBackgroundImagePath { get; };
INHERITABLE_APPEARANCE_SETTING(Double, BackgroundImageOpacity);
INHERITABLE_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode);
INHERITABLE_APPEARANCE_SETTING(ConvergedAlignment, BackgroundImageAlignment);
INHERITABLE_APPEARANCE_SETTING(Boolean, RetroTerminalEffect);
INHERITABLE_APPEARANCE_SETTING(String, PixelShaderPath);
INHERITABLE_APPEARANCE_SETTING(IntenseStyle, IntenseTextStyle);
INHERITABLE_APPEARANCE_SETTING(Double, Opacity);
};
}