You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for background image alignment (as one setting) (microsoft#1959)
* Implement base background image alignment settings
TerminalSettings now has two new properties:
* BackgroundImageHorizontalAlignment
* BackgroundImageVerticalAlignment
These properties are used in TermControl::_InitializeBackgroundBrush to specify the alignment for TermControl::_bgImageLayer.
This is a base commit that will split into two possible branches:
* Use one setting in profiles.json: "backgroundImageAlignment"
* Use two settings in profiles.json: "backgroundImageHorizontal/VerticalAlignment"
* Implement background image alignment profile setting
Implement background image alignment as one profile setting.
* This has the benefit of acting as a single setting when the user would likely want to change both horizontal and vertical alignment.
* HorizontalAlignment and VerticalAlignment are still stored as a tuple in Profile because they are an optional field. And thus, it would not make sense for one of the alignments to be left unused while the other is not.
* Cons are that the tuple signature is quite long, but it is only used in a small number of locations. The Serialize method is also a little mishapen with the nested switch statements. Empty lines have been added between base-level cases to improve readability.
* Fix capitalization typo for BackgroundImageStretchModeKey
In Profiles.cpp, the key for the image stretch mode json property had a lowercase 'i' in "Backgroundimage", not following proper UpperCamelCase.
The "i" has been capitalized and the two usages of the constant have been updated as well.
* Document Background Image settings
* Adds entries SettingsSchema.md for the original 3 backgroundImage settings in addition to the new backgroundImageAlignment setting.
* Fix setting capitalization error in UsingJsonSettings.md
* The background image example in UsingJsonSettings.md listing a backgroundImageStretchMode of "Fill" has been corrected to "fill".
Fixesmicrosoft#1949.
Copy file name to clipboardExpand all lines: doc/cascadia/SettingsSchema.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,10 @@ Properties listed below are specific to each unique profile.
35
35
|`startingDirectory`|_Required_| String |`%USERPROFILE%`| The directory the shell starts in when it is loaded. |
36
36
|`useAcrylic`|_Required_| Boolean |`false`| When set to `true`, the window will have an acrylic background. When set to `false`, the window will have a plain, untextured background. |
37
37
|`background`| Optional | String || Sets the background color of the profile. Overrides `background` set in color scheme if `colorscheme` is set. Uses hex color format: `"#rrggbb"`. |
38
+
|`backgroundImage`| Optional | String || Sets the file location of the Image to draw over the window background. |
39
+
|`backgroundImageAlignment`| Optional | String |`center`| Sets how the background image aligns to the boundaries of the window. Possible values: `"center"`, `"left"`, `"top"`, `"right"`, `"bottom"`, `"topLeft"`, `"topRight"`, `"bottomLeft"`, `"bottomRight"`|
40
+
|`backgroundImageOpacity`| Optional | Number |`1.0`| Sets the transparency of the background image. Accepts floating point values from 0-1. |
41
+
|`backgroundImageStretchMode`| Optional | String |`uniformToFill`| Sets how the background image is resized to fill the window. Possible values: `"none"`, `"fill"`, `"uniform"`, `"uniformToFill"`|
38
42
|`colorTable`| Optional | Array[String]|| Array of colors used in the profile if `colorscheme` is not set. Colors use hex color format: `"#rrggbb"`. Ordering is as follows: `[black, red, green, yellow, blue, magenta, cyan, white, bright black, bright red, bright green, bright yellow, bright blue, bright magenta, bright cyan, bright white]`|
39
43
|`cursorHeight`| Optional | Integer || Sets the percentage height of the cursor starting from the bottom. Only works when `cursorShape` is set to `"vintage"`. Accepts values from 25-100. |
40
44
|`foreground`| Optional | String || Sets the foreground color of the profile. Overrides `foreground` set in color scheme if `colorscheme` is set. Uses hex color format: `"#rrggbb"`. |
0 commit comments