mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-07 23:01:09 +00:00
Compare commits
5 Commits
dev/miniks
...
dev/cazamo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
034643e6ef | ||
|
|
1087a34f0e | ||
|
|
36357d6b8f | ||
|
|
c450551bdc | ||
|
|
0e98b5cc63 |
@@ -125,7 +125,7 @@ Team members will be happy to help review specs and guide them to completion.
|
||||
|
||||
### Help Wanted
|
||||
|
||||
Once the team have approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/terminal/labels/Help%20Wanted).
|
||||
Once the team have approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/terminal/labels/Help-Wanted).
|
||||
|
||||
---
|
||||
|
||||
@@ -155,4 +155,4 @@ Once your code has been reviewed and approved by the requisite number of team me
|
||||
|
||||
## Thank you
|
||||
|
||||
Thank you in advance for your contribution! Now, [what's next on the list](https://github.com/microsoft/terminal/labels/Help%20Wanted)? 😜
|
||||
Thank you in advance for your contribution! Now, [what's next on the list](https://github.com/microsoft/terminal/labels/Help-Wanted)? 😜
|
||||
|
||||
@@ -231,7 +231,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests_TerminalApp", "sr
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAppLib", "src\cascadia\TerminalApp\lib\TerminalAppLib.vcxproj", "{CA5CAD1A-9A12-429C-B551-8562EC954746}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}
|
||||
EndProjectSection
|
||||
@@ -303,8 +302,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAzBridge", "src\cas
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "src\dep\fmt\fmt.vcxproj", "{6BAE5851-50D5-4934-8D5E-30361A8A40F3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalSettingsControl", "src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj", "{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
AuditMode|Any CPU = AuditMode|Any CPU
|
||||
@@ -1511,27 +1508,6 @@ Global
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x64.Build.0 = Release|x64
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.ActiveCfg = AuditMode|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.Build.0 = AuditMode|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.Build.0 = AuditMode|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.Build.0 = Debug|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.Build.0 = Debug|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -1610,7 +1586,6 @@ Global
|
||||
{024052DE-83FB-4653-AEA4-90790D29D5BD} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
|
||||
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
|
||||
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}
|
||||
|
||||
24
README.md
24
README.md
@@ -2,8 +2,7 @@
|
||||
|
||||
This repository contains the source code for:
|
||||
|
||||
* [Windows Terminal](https://aka.ms/terminal)
|
||||
* [Windows Terminal Preview](https://aka.ms/terminal-preview)
|
||||
* [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701)
|
||||
* The Windows console host (`conhost.exe`)
|
||||
* Components shared between the two projects
|
||||
* [ColorTool](https://github.com/Microsoft/Terminal/tree/master/src/tools/ColorTool)
|
||||
@@ -11,7 +10,6 @@ This repository contains the source code for:
|
||||
|
||||
Related repositories include:
|
||||
|
||||
* [Windows Terminal Documentation](https://docs.microsoft.com/windows/terminal) ([Repo: Contribute to the docs](https://github.com/MicrosoftDocs/terminal))
|
||||
* [Console API Documentation](https://github.com/MicrosoftDocs/Console-Docs)
|
||||
* [Cascadia Code Font](https://github.com/Microsoft/Cascadia-Code)
|
||||
|
||||
@@ -21,7 +19,7 @@ Related repositories include:
|
||||
|
||||
### Microsoft Store [Recommended]
|
||||
|
||||
Install the [Windows Terminal from the Microsoft Store][store-install-link]. This allows you to always be on the latest version when we release new builds with automatic upgrades.
|
||||
Install the [Windows Terminal from the Microsoft Store][store-install-link]. This allows you to always be on the latest version when we release new builds with automatic upgrades.
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
@@ -36,14 +34,6 @@ For users who are unable to install Terminal from the Microsoft Store, Terminal
|
||||
> * Be sure to install the [Desktop Bridge VC++ v14 Redistributable Package](https://www.microsoft.com/en-us/download/details.aspx?id=53175) otherwise Terminal may not install and/or run and may crash at startup
|
||||
> * Terminal will not auto-update when new builds are released so you will need to regularly install the latest Terminal release to receive all the latest fixes and improvements!
|
||||
|
||||
#### Via Windows Package Manager CLI (aka winget)
|
||||
|
||||
[winget](https://github.com/microsoft/winget-cli) users can download and install the latest Terminal release by installing the `Microsoft.WindowsTerminal` package:
|
||||
|
||||
```powershell
|
||||
winget install --id=Microsoft.WindowsTerminal -e
|
||||
```
|
||||
|
||||
#### Via Chocolatey (unofficial)
|
||||
|
||||
[Chocolatey](https://chocolatey.org) users can download and install the latest Terminal release by installing the `microsoft-windows-terminal` package:
|
||||
@@ -71,6 +61,12 @@ ColorTool|, and will be updated as the project proceeds.
|
||||
|
||||
---
|
||||
|
||||
## Terminal & Console Overview
|
||||
|
||||
Please take a few minutes to review the overview below before diving into the code:
|
||||
@@ -135,7 +131,7 @@ Solution: Make sure you're building & deploying the `CascadiaPackage` project in
|
||||
|
||||
## Documentation
|
||||
|
||||
All project documentation is located at aka.ms/terminal-docs. If you would like to contribute to the documentation, please submit a pull request on the [Windows Terminal Documentation repo](https://github.com/MicrosoftDocs/terminal).
|
||||
All project documentation is located in the `./doc` folder. If you would like to contribute to the documentation, please submit a pull request.
|
||||
|
||||
---
|
||||
|
||||
@@ -230,4 +226,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open
|
||||
[conduct-code]: https://opensource.microsoft.com/codeofconduct/
|
||||
[conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/
|
||||
[conduct-email]: mailto:opencode@microsoft.com
|
||||
[store-install-link]: https://aka.ms/terminal
|
||||
[store-install-link]: https://aka.ms/windowsterminal
|
||||
|
||||
@@ -47,7 +47,6 @@ Properties listed below are specific to each unique profile.
|
||||
| `cursorShape` | Optional | String | `bar` | Sets the cursor shape for the profile. Possible values: `"vintage"` ( ▃ ), `"bar"` ( ┃ ), `"underscore"` ( ▁ ), `"filledBox"` ( █ ), `"emptyBox"` ( ▯ ) |
|
||||
| `fontFace` | Optional | String | `Cascadia Mono` | Name of the font face used in the profile. We will try to fallback to Consolas if this can't be found or is invalid. |
|
||||
| `fontSize` | Optional | Integer | `12` | Sets the font size. |
|
||||
| `fontWeight` | Optional | String | `normal` | Sets the weight (lightness or heaviness of the strokes) for the given font. Possible values: `"thin"`, `"extra-light"`, `"light"`, `"semi-light"`, `"normal"`, `"medium"`, `"semi-bold"`, `"bold"`, `"extra-bold"`, `"black"`, `"extra-black"`, or the corresponding numeric representation of OpenType font weight. |
|
||||
| `foreground` | Optional | String | | Sets the foreground color of the profile. Overrides `foreground` set in color scheme if `colorscheme` is set. Uses hex color format: `#rgb` or `"#rrggbb"`. |
|
||||
| `hidden` | Optional | Boolean | `false` | If set to true, the profile will not appear in the list of profiles. This can be used to hide default profiles and dynamically generated profiles, while leaving them in your settings file. |
|
||||
| `historySize` | Optional | Integer | `9001` | The number of lines above the ones displayed in the window you can scroll back to. |
|
||||
|
||||
@@ -531,32 +531,6 @@
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"fontWeight": {
|
||||
"default": "normal",
|
||||
"description": "Sets the weight (lightness or heaviness of the strokes) for the given font. Possible values:\n -\"thin\"\n -\"extra-light\"\n -\"light\"\n -\"semi-light\"\n -\"normal\" (default)\n -\"medium\"\n -\"semi-bold\"\n -\"bold\"\n -\"extra-bold\"\n -\"black\"\n -\"extra-black\" or the corresponding numeric representation of OpenType font weight.",
|
||||
"oneOf": [
|
||||
{
|
||||
"enum": [
|
||||
"thin",
|
||||
"extra-light",
|
||||
"light",
|
||||
"semi-light",
|
||||
"normal",
|
||||
"medium",
|
||||
"semi-bold",
|
||||
"bold",
|
||||
"extra-bold",
|
||||
"black",
|
||||
"extra-black"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"maximum": 990,
|
||||
"minimum": 100,
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
"foreground": {
|
||||
"$ref": "#/definitions/Color",
|
||||
"default": "#cccccc",
|
||||
|
||||
@@ -88,7 +88,7 @@ This will allow you to simplify the above snippet as follows:
|
||||
}
|
||||
```
|
||||
|
||||
A list of default key bindings is available [here](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/defaults.json#L204).
|
||||
|
||||
|
||||
### Unbinding keys
|
||||
|
||||
@@ -160,7 +160,7 @@ Example settings include
|
||||
|
||||
The profile GUID is used to reference the default profile in the global settings.
|
||||
|
||||
The values for background image stretch mode are documented [here](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.stretch).
|
||||
The values for background image stretch mode are documented [here](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.stretch)
|
||||
|
||||
### Hiding a profile
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ To customize the shell list, see the _Configuring Windows Terminal_ section belo
|
||||
|
||||
## Starting a new PowerShell tab with admin privilege
|
||||
|
||||
There is no current plan to support this feature for security reasons. See issue [#632](https://github.com/microsoft/terminal/issues/632)
|
||||
There is no current plan to support this feature for security reasons. See issue [#623](https://github.com/microsoft/terminal/issues/632)
|
||||
|
||||
## Selecting and Copying Text in Windows Terminal
|
||||
|
||||
@@ -87,5 +87,4 @@ For an introduction to the various settings, see [Using Json Settings](UsingJson
|
||||
2. Terminal zoom can be changed by holding <kbd>Ctrl</kbd> and scrolling with mouse.
|
||||
3. Background opacity can be changed by holding <kbd>Ctrl</kbd>+<kbd>Shift</kbd> and scrolling with mouse. Note that acrylic transparency is limited by the OS only to focused windows.
|
||||
4. Open Windows Terminal in current directory by typing `wt -d .` in the address bar.
|
||||
5. Pin the Windows Terminal to the taskbar. Now it can be launched using the Windows shortcut <kbd>Win</kbd>+<kbd>Number</kbd> (e.g. <kbd>Win</kbd>+<kbd>1</kbd> or any other number based on the position in the taskbar!). Press <kbd>Win</kbd>+<kbd>Shift</kbd>+<kbd>Number</kbd> to always launch a new window.
|
||||
6. Please add more Tips and Tricks.
|
||||
5. Please add more Tips and Tricks.
|
||||
|
||||
BIN
res/Cascadia.ttf
BIN
res/Cascadia.ttf
Binary file not shown.
Binary file not shown.
@@ -17,5 +17,5 @@ Please consult the [license](https://raw.githubusercontent.com/microsoft/cascadi
|
||||
|
||||
### Fonts Included
|
||||
|
||||
* Cascadia Code, Cascadia Mono (2005.15)
|
||||
* from microsoft/cascadia-code@0610f2df4356200adb93cb5bca2221b92ad6ee7e
|
||||
* Cascadia Code, Cascadia Mono (2004.30)
|
||||
* from microsoft/cascadia-code@5795d16e36748612b726164fd8b59f3c1c8b0788
|
||||
|
||||
@@ -783,7 +783,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
VERIFY_IS_FALSE(profile0._guid.has_value());
|
||||
|
||||
const auto serialized0Profile = profile0.GenerateStub();
|
||||
const auto serialized0Profile = profile0.ToJson();
|
||||
const auto profile1 = Profile::FromJson(serialized0Profile);
|
||||
VERIFY_IS_FALSE(profile0._guid.has_value());
|
||||
VERIFY_ARE_EQUAL(profile1._guid.has_value(), profile0._guid.has_value());
|
||||
@@ -794,7 +794,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
VERIFY_IS_TRUE(settings._profiles.at(0)._guid.has_value());
|
||||
|
||||
const auto serialized1Profile = settings._profiles.at(0).GenerateStub();
|
||||
const auto serialized1Profile = settings._profiles.at(0).ToJson();
|
||||
|
||||
const auto profile2 = Profile::FromJson(serialized1Profile);
|
||||
VERIFY_IS_TRUE(settings._profiles.at(0)._guid.has_value());
|
||||
|
||||
@@ -47,7 +47,7 @@ ColorScheme::ColorScheme() :
|
||||
{
|
||||
}
|
||||
|
||||
ColorScheme::ColorScheme(std::wstring name, til::color defaultFg, til::color defaultBg, til::color cursorColor) :
|
||||
ColorScheme::ColorScheme(std::wstring name, COLORREF defaultFg, COLORREF defaultBg, COLORREF cursorColor) :
|
||||
_schemeName{ name },
|
||||
_table{},
|
||||
_defaultForeground{ defaultFg },
|
||||
@@ -70,18 +70,44 @@ ColorScheme::~ColorScheme()
|
||||
// - <none>
|
||||
void ColorScheme::ApplyScheme(TerminalSettings terminalSettings) const
|
||||
{
|
||||
terminalSettings.DefaultForeground(static_cast<COLORREF>(_defaultForeground));
|
||||
terminalSettings.DefaultBackground(static_cast<COLORREF>(_defaultBackground));
|
||||
terminalSettings.SelectionBackground(static_cast<COLORREF>(_selectionBackground));
|
||||
terminalSettings.CursorColor(static_cast<COLORREF>(_cursorColor));
|
||||
terminalSettings.DefaultForeground(_defaultForeground);
|
||||
terminalSettings.DefaultBackground(_defaultBackground);
|
||||
terminalSettings.SelectionBackground(_selectionBackground);
|
||||
terminalSettings.CursorColor(_cursorColor);
|
||||
|
||||
auto const tableCount = gsl::narrow_cast<int>(_table.size());
|
||||
for (int i = 0; i < tableCount; i++)
|
||||
{
|
||||
terminalSettings.SetColorTableEntry(i, static_cast<COLORREF>(_table[i]));
|
||||
terminalSettings.SetColorTableEntry(i, _table[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value ColorScheme::ToJson() const
|
||||
{
|
||||
Json::Value root;
|
||||
root[JsonKey(NameKey)] = winrt::to_string(_schemeName);
|
||||
root[JsonKey(ForegroundKey)] = Utils::ColorToHexString(_defaultForeground);
|
||||
root[JsonKey(BackgroundKey)] = Utils::ColorToHexString(_defaultBackground);
|
||||
root[JsonKey(SelectionBackgroundKey)] = Utils::ColorToHexString(_selectionBackground);
|
||||
root[JsonKey(CursorColorKey)] = Utils::ColorToHexString(_cursorColor);
|
||||
|
||||
int i = 0;
|
||||
for (const auto& colorName : TableColors)
|
||||
{
|
||||
auto& colorValue = _table.at(i);
|
||||
root[JsonKey(colorName)] = Utils::ColorToHexString(colorValue);
|
||||
i++;
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Create a new instance of this class from a serialized JsonObject.
|
||||
// Arguments:
|
||||
@@ -167,27 +193,27 @@ std::wstring_view ColorScheme::GetName() const noexcept
|
||||
return { _schemeName };
|
||||
}
|
||||
|
||||
std::array<til::color, COLOR_TABLE_SIZE>& ColorScheme::GetTable() noexcept
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE>& ColorScheme::GetTable() noexcept
|
||||
{
|
||||
return _table;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetForeground() const noexcept
|
||||
COLORREF ColorScheme::GetForeground() const noexcept
|
||||
{
|
||||
return _defaultForeground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetBackground() const noexcept
|
||||
COLORREF ColorScheme::GetBackground() const noexcept
|
||||
{
|
||||
return _defaultBackground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetSelectionBackground() const noexcept
|
||||
COLORREF ColorScheme::GetSelectionBackground() const noexcept
|
||||
{
|
||||
return _selectionBackground;
|
||||
}
|
||||
|
||||
til::color ColorScheme::GetCursorColor() const noexcept
|
||||
COLORREF ColorScheme::GetCursorColor() const noexcept
|
||||
{
|
||||
return _cursorColor;
|
||||
}
|
||||
|
||||
@@ -35,31 +35,32 @@ class TerminalApp::ColorScheme
|
||||
{
|
||||
public:
|
||||
ColorScheme();
|
||||
ColorScheme(std::wstring name, til::color defaultFg, til::color defaultBg, til::color cursorColor);
|
||||
ColorScheme(std::wstring name, COLORREF defaultFg, COLORREF defaultBg, COLORREF cursorColor);
|
||||
~ColorScheme();
|
||||
|
||||
void ApplyScheme(winrt::Microsoft::Terminal::Settings::TerminalSettings terminalSettings) const;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
static ColorScheme FromJson(const Json::Value& json);
|
||||
bool ShouldBeLayered(const Json::Value& json) const;
|
||||
void LayerJson(const Json::Value& json);
|
||||
|
||||
std::wstring_view GetName() const noexcept;
|
||||
std::array<til::color, COLOR_TABLE_SIZE>& GetTable() noexcept;
|
||||
til::color GetForeground() const noexcept;
|
||||
til::color GetBackground() const noexcept;
|
||||
til::color GetSelectionBackground() const noexcept;
|
||||
til::color GetCursorColor() const noexcept;
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE>& GetTable() noexcept;
|
||||
COLORREF GetForeground() const noexcept;
|
||||
COLORREF GetBackground() const noexcept;
|
||||
COLORREF GetSelectionBackground() const noexcept;
|
||||
COLORREF GetCursorColor() const noexcept;
|
||||
|
||||
static std::optional<std::wstring> GetNameFromJson(const Json::Value& json);
|
||||
|
||||
private:
|
||||
std::wstring _schemeName;
|
||||
std::array<til::color, COLOR_TABLE_SIZE> _table;
|
||||
til::color _defaultForeground;
|
||||
til::color _defaultBackground;
|
||||
til::color _selectionBackground;
|
||||
til::color _cursorColor;
|
||||
std::array<COLORREF, COLOR_TABLE_SIZE> _table;
|
||||
COLORREF _defaultForeground;
|
||||
COLORREF _defaultBackground;
|
||||
COLORREF _selectionBackground;
|
||||
COLORREF _cursorColor;
|
||||
|
||||
friend class TerminalAppLocalTests::SettingsTests;
|
||||
friend class TerminalAppLocalTests::ColorSchemeTests;
|
||||
|
||||
@@ -249,6 +249,40 @@ void GlobalAppSettings::ApplyToSettings(TerminalSettings& settings) const noexce
|
||||
settings.SoftwareRendering(_softwareRendering);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value GlobalAppSettings::ToJson() const
|
||||
{
|
||||
Json::Value jsonObject;
|
||||
|
||||
jsonObject[JsonKey(DefaultProfileKey)] = winrt::to_string(Utils::GuidToString(_defaultProfile));
|
||||
jsonObject[JsonKey(InitialRowsKey)] = _initialRows;
|
||||
jsonObject[JsonKey(InitialColsKey)] = _initialCols;
|
||||
jsonObject[JsonKey(RowsToScrollKey)] = _rowsToScroll;
|
||||
jsonObject[JsonKey(InitialPositionKey)] = _SerializeInitialPosition(_initialX, _initialY);
|
||||
jsonObject[JsonKey(AlwaysShowTabsKey)] = _alwaysShowTabs;
|
||||
jsonObject[JsonKey(ShowTitleInTitlebarKey)] = _showTitleInTitlebar;
|
||||
jsonObject[JsonKey(ShowTabsInTitlebarKey)] = _showTabsInTitlebar;
|
||||
jsonObject[JsonKey(WordDelimitersKey)] = winrt::to_string(_wordDelimiters);
|
||||
jsonObject[JsonKey(CopyOnSelectKey)] = _copyOnSelect;
|
||||
jsonObject[JsonKey(CopyFormattingKey)] = _copyFormatting;
|
||||
jsonObject[JsonKey(LaunchModeKey)] = winrt::to_string(_SerializeLaunchMode(_launchMode));
|
||||
jsonObject[JsonKey(ThemeKey)] = winrt::to_string(_SerializeTheme(_theme));
|
||||
jsonObject[JsonKey(TabWidthModeKey)] = winrt::to_string(_SerializeTabWidthMode(_tabWidthMode));
|
||||
jsonObject[JsonKey(KeybindingsKey)] = _keybindings->ToJson();
|
||||
jsonObject[JsonKey(ConfirmCloseAllKey)] = _confirmCloseAllTabs;
|
||||
jsonObject[JsonKey(SnapToGridOnResizeKey)] = _SnapToGridOnResize;
|
||||
jsonObject[JsonKey(ForceFullRepaintRenderingKey)] = _forceFullRepaintRendering;
|
||||
jsonObject[JsonKey(SoftwareRenderingKey)] = _softwareRendering;
|
||||
jsonObject[JsonKey(DebugFeaturesKey)] = _debugFeatures;
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Create a new instance of this class from a serialized JsonObject.
|
||||
// Arguments:
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
|
||||
bool DebugFeaturesEnabled() const noexcept;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
static GlobalAppSettings FromJson(const Json::Value& json);
|
||||
void LayerJson(const Json::Value& json);
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
void TerminalApp::JsonUtils::GetOptionalColor(const Json::Value& json,
|
||||
std::string_view key,
|
||||
std::optional<til::color>& target)
|
||||
std::optional<uint32_t>& target)
|
||||
{
|
||||
const auto conversionFn = [](const Json::Value& value) -> til::color {
|
||||
const auto conversionFn = [](const Json::Value& value) -> uint32_t {
|
||||
return ::Microsoft::Console::Utils::ColorFromHexString(value.asString());
|
||||
};
|
||||
GetOptionalValue(json,
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace TerminalApp::JsonUtils
|
||||
{
|
||||
void GetOptionalColor(const Json::Value& json,
|
||||
std::string_view key,
|
||||
std::optional<til::color>& target);
|
||||
std::optional<uint32_t>& target);
|
||||
|
||||
void GetOptionalString(const Json::Value& json,
|
||||
std::string_view key,
|
||||
|
||||
@@ -40,53 +40,15 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void MinMaxCloseControl::SetWindowVisualState(WindowVisualState visualState)
|
||||
{
|
||||
// Look up the heights we should use for the caption buttons from our
|
||||
// XAML resources. "CaptionButtonHeightWindowed" and
|
||||
// "CaptionButtonHeightMaximized" define the size we should use for the
|
||||
// caption buttons height for the windowed and maximized states,
|
||||
// respectively.
|
||||
//
|
||||
// use C++11 magic statics to make sure we only do this once.
|
||||
static auto heights = [this]() {
|
||||
const auto res = Resources();
|
||||
const auto windowedHeightKey = winrt::box_value(L"CaptionButtonHeightWindowed");
|
||||
const auto maximizedHeightKey = winrt::box_value(L"CaptionButtonHeightMaximized");
|
||||
|
||||
auto windowedHeight = 0.0;
|
||||
auto maximizedHeight = 0.0;
|
||||
if (res.HasKey(windowedHeightKey))
|
||||
{
|
||||
const auto valFromResources = res.Lookup(windowedHeightKey);
|
||||
windowedHeight = winrt::unbox_value_or<double>(valFromResources, 0.0);
|
||||
}
|
||||
if (res.HasKey(maximizedHeightKey))
|
||||
{
|
||||
const auto valFromResources = res.Lookup(maximizedHeightKey);
|
||||
maximizedHeight = winrt::unbox_value_or<double>(valFromResources, 0.0);
|
||||
}
|
||||
return std::tuple<double, double>{ windowedHeight, maximizedHeight };
|
||||
}();
|
||||
static const auto windowedHeight = std::get<0>(heights);
|
||||
static const auto maximizedHeight = std::get<1>(heights);
|
||||
|
||||
switch (visualState)
|
||||
{
|
||||
case WindowVisualState::WindowVisualStateMaximized:
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"WindowStateMaximized", false);
|
||||
|
||||
MinimizeButton().Height(maximizedHeight);
|
||||
MaximizeButton().Height(maximizedHeight);
|
||||
CloseButton().Height(maximizedHeight);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(MaximizeButton(), L"WindowStateMaximized", false);
|
||||
break;
|
||||
|
||||
case WindowVisualState::WindowVisualStateNormal:
|
||||
case WindowVisualState::WindowVisualStateIconified:
|
||||
default:
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"WindowStateNormal", false);
|
||||
|
||||
MinimizeButton().Height(windowedHeight);
|
||||
MaximizeButton().Height(windowedHeight);
|
||||
CloseButton().Height(windowedHeight);
|
||||
winrt::Windows::UI::Xaml::VisualStateManager::GoToState(MaximizeButton(), L"WindowStateNormal", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,18 +62,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
<x:String x:Key="CaptionButtonPath"></x:String>
|
||||
<x:String x:Key="CaptionButtonPathWindowMaximized"></x:String>
|
||||
|
||||
<!-- "CaptionButtonHeightWindowed" and
|
||||
"CaptionButtonHeightMaximized" define the size we should use
|
||||
for the caption buttons height for the windowed and maximized
|
||||
states, respectively.
|
||||
|
||||
32 was chosen for the Maximized height to match the height of
|
||||
the TabRowControl. This way, when the window is maximized, the
|
||||
tabs will be flush with the top of the window. See GH#2541 for
|
||||
details.-->
|
||||
<x:Double x:Key="CaptionButtonHeightWindowed">36.0</x:Double>
|
||||
<x:Double x:Key="CaptionButtonHeightMaximized">32.0</x:Double>
|
||||
|
||||
<Style x:Key="CaptionButton" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Background" Value="{ThemeResource CaptionButtonBackground}" />
|
||||
@@ -81,7 +69,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
||||
<Border x:Name="ButtonBaseElement"
|
||||
Background="{TemplateBinding Background}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
@@ -136,7 +123,6 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeStartLineCap="Square" />
|
||||
</Border>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@@ -145,7 +131,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</StackPanel.Resources>
|
||||
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="MinimizeButton"
|
||||
x:Uid="WindowMinimizeButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
@@ -157,7 +143,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="MaximizeButton"
|
||||
x:Uid="WindowMaximizeButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
@@ -170,7 +156,7 @@ the MIT License. See LICENSE in the project root for license information. -->
|
||||
</ResourceDictionary>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button Height="{StaticResource CaptionButtonHeightWindowed}" MinWidth="46.0" Width="46.0"
|
||||
<Button Height="36.0" MinWidth="46.0" Width="46.0"
|
||||
x:Name="CloseButton"
|
||||
x:Uid="WindowCloseButton"
|
||||
Style="{StaticResource CaptionButton}"
|
||||
|
||||
@@ -36,7 +36,6 @@ static constexpr std::string_view ConnectionTypeKey{ "connectionType" };
|
||||
static constexpr std::string_view CommandlineKey{ "commandline" };
|
||||
static constexpr std::string_view FontFaceKey{ "fontFace" };
|
||||
static constexpr std::string_view FontSizeKey{ "fontSize" };
|
||||
static constexpr std::string_view FontWeightKey{ "fontWeight" };
|
||||
static constexpr std::string_view AcrylicTransparencyKey{ "acrylicOpacity" };
|
||||
static constexpr std::string_view UseAcrylicKey{ "useAcrylic" };
|
||||
static constexpr std::string_view ScrollbarStateKey{ "scrollbarState" };
|
||||
@@ -67,24 +66,12 @@ static constexpr std::wstring_view CursorShapeUnderscore{ L"underscore" };
|
||||
static constexpr std::wstring_view CursorShapeFilledbox{ L"filledBox" };
|
||||
static constexpr std::wstring_view CursorShapeEmptybox{ L"emptyBox" };
|
||||
|
||||
// Possible values for Font Weight
|
||||
static constexpr std::string_view FontWeightThin{ "thin" };
|
||||
static constexpr std::string_view FontWeightExtraLight{ "extra-light" };
|
||||
static constexpr std::string_view FontWeightLight{ "light" };
|
||||
static constexpr std::string_view FontWeightSemiLight{ "semi-light" };
|
||||
static constexpr std::string_view FontWeightNormal{ "normal" };
|
||||
static constexpr std::string_view FontWeightMedium{ "medium" };
|
||||
static constexpr std::string_view FontWeightSemiBold{ "semi-bold" };
|
||||
static constexpr std::string_view FontWeightBold{ "bold" };
|
||||
static constexpr std::string_view FontWeightExtraBold{ "extra-bold" };
|
||||
static constexpr std::string_view FontWeightBlack{ "black" };
|
||||
static constexpr std::string_view FontWeightExtraBlack{ "extra-black" };
|
||||
|
||||
// Possible values for Image Stretch Mode
|
||||
static constexpr std::string_view ImageStretchModeNone{ "none" };
|
||||
static constexpr std::string_view ImageStretchModeFill{ "fill" };
|
||||
static constexpr std::string_view ImageStretchModeUniform{ "uniform" };
|
||||
static constexpr std::string_view ImageStretchModeUniformTofill{ "uniformToFill" };
|
||||
static constexpr std::string_view ImageStretchModeTile{ "tile" };
|
||||
|
||||
// Possible values for Image Alignment
|
||||
static constexpr std::string_view ImageAlignmentCenter{ "center" };
|
||||
@@ -129,7 +116,6 @@ Profile::Profile(const std::optional<GUID>& guid) :
|
||||
_startingDirectory{},
|
||||
_fontFace{ DEFAULT_FONT_FACE },
|
||||
_fontSize{ DEFAULT_FONT_SIZE },
|
||||
/* _fontWeight is initialized below because the structure won't accept a uint16_t directly */
|
||||
_acrylicTransparency{ 0.5 },
|
||||
_useAcrylic{ false },
|
||||
_scrollbarState{},
|
||||
@@ -143,9 +129,6 @@ Profile::Profile(const std::optional<GUID>& guid) :
|
||||
_retroTerminalEffect{},
|
||||
_antialiasingMode{ TextAntialiasingMode::Grayscale }
|
||||
{
|
||||
winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = DEFAULT_FONT_WEIGHT;
|
||||
_fontWeight = weight;
|
||||
}
|
||||
|
||||
Profile::~Profile()
|
||||
@@ -198,7 +181,6 @@ TerminalSettings Profile::CreateTerminalSettings(const std::unordered_map<std::w
|
||||
|
||||
terminalSettings.FontFace(_fontFace);
|
||||
terminalSettings.FontSize(_fontSize);
|
||||
terminalSettings.FontWeight(_fontWeight);
|
||||
terminalSettings.Padding(_padding);
|
||||
|
||||
terminalSettings.Commandline(_commandline);
|
||||
@@ -282,6 +264,183 @@ TerminalSettings Profile::CreateTerminalSettings(const std::unordered_map<std::w
|
||||
return terminalSettings;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Serialize this object to a JsonObject.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - a JsonObject which is an equivalent serialization of this object.
|
||||
Json::Value Profile::ToJson() const
|
||||
{
|
||||
Json::Value root = GenerateStub();
|
||||
|
||||
///// Profile-specific settings /////
|
||||
// As of #2795, all profile-specific settings were moved to GenerateStub. If
|
||||
// any new profiles-specific settings are added, they should probably be
|
||||
// added here instead of in that method.
|
||||
|
||||
///// Core Settings /////
|
||||
if (_defaultForeground)
|
||||
{
|
||||
root[JsonKey(ForegroundKey)] = Utils::ColorToHexString(_defaultForeground.value());
|
||||
}
|
||||
if (_defaultBackground)
|
||||
{
|
||||
root[JsonKey(BackgroundKey)] = Utils::ColorToHexString(_defaultBackground.value());
|
||||
}
|
||||
if (_selectionBackground)
|
||||
{
|
||||
root[JsonKey(SelectionBackgroundKey)] = Utils::ColorToHexString(_selectionBackground.value());
|
||||
}
|
||||
if (_cursorColor)
|
||||
{
|
||||
root[JsonKey(CursorColorKey)] = Utils::ColorToHexString(_cursorColor.value());
|
||||
}
|
||||
if (_schemeName)
|
||||
{
|
||||
const auto scheme = winrt::to_string(_schemeName.value());
|
||||
root[JsonKey(ColorSchemeKey)] = scheme;
|
||||
}
|
||||
root[JsonKey(HistorySizeKey)] = _historySize;
|
||||
root[JsonKey(SnapOnInputKey)] = _snapOnInput;
|
||||
// Only add the cursor height property if we're a legacy-style cursor.
|
||||
if (_cursorShape == CursorStyle::Vintage)
|
||||
{
|
||||
root[JsonKey(CursorHeightKey)] = _cursorHeight;
|
||||
}
|
||||
root[JsonKey(CursorShapeKey)] = winrt::to_string(_SerializeCursorStyle(_cursorShape));
|
||||
|
||||
root[JsonKey(CommandlineKey)] = winrt::to_string(_commandline);
|
||||
root[JsonKey(FontFaceKey)] = winrt::to_string(_fontFace);
|
||||
root[JsonKey(FontSizeKey)] = _fontSize;
|
||||
root[JsonKey(AcrylicTransparencyKey)] = _acrylicTransparency;
|
||||
root[JsonKey(UseAcrylicKey)] = _useAcrylic;
|
||||
root[JsonKey(PaddingKey)] = winrt::to_string(_padding);
|
||||
|
||||
if (_connectionType)
|
||||
{
|
||||
root[JsonKey(ConnectionTypeKey)] = winrt::to_string(Utils::GuidToString(_connectionType.value()));
|
||||
}
|
||||
if (_scrollbarState)
|
||||
{
|
||||
const auto scrollbarState = winrt::to_string(_scrollbarState.value());
|
||||
root[JsonKey(ScrollbarStateKey)] = scrollbarState;
|
||||
}
|
||||
|
||||
if (_icon)
|
||||
{
|
||||
const auto icon = winrt::to_string(_icon.value());
|
||||
root[JsonKey(IconKey)] = icon;
|
||||
}
|
||||
|
||||
if (_tabTitle)
|
||||
{
|
||||
root[JsonKey(TabTitleKey)] = winrt::to_string(_tabTitle.value());
|
||||
}
|
||||
|
||||
if (_suppressApplicationTitle)
|
||||
{
|
||||
root[JsonKey(SuppressApplicationTitleKey)] = _suppressApplicationTitle;
|
||||
}
|
||||
|
||||
if (_startingDirectory)
|
||||
{
|
||||
root[JsonKey(StartingDirectoryKey)] = winrt::to_string(_startingDirectory.value());
|
||||
}
|
||||
|
||||
if (_backgroundImage)
|
||||
{
|
||||
root[JsonKey(BackgroundImageKey)] = winrt::to_string(_backgroundImage.value());
|
||||
}
|
||||
|
||||
if (_backgroundImageOpacity)
|
||||
{
|
||||
root[JsonKey(BackgroundImageOpacityKey)] = _backgroundImageOpacity.value();
|
||||
}
|
||||
|
||||
if (_backgroundImageStretchMode)
|
||||
{
|
||||
root[JsonKey(BackgroundImageStretchModeKey)] = SerializeImageStretchMode(_backgroundImageStretchMode.value()).data();
|
||||
}
|
||||
|
||||
if (_backgroundImageAlignment)
|
||||
{
|
||||
root[JsonKey(BackgroundImageAlignmentKey)] = SerializeImageAlignment(_backgroundImageAlignment.value()).data();
|
||||
}
|
||||
|
||||
root[JsonKey(CloseOnExitKey)] = _SerializeCloseOnExitMode(_closeOnExitMode).data();
|
||||
|
||||
if (_retroTerminalEffect)
|
||||
{
|
||||
root[JsonKey(RetroTerminalEffectKey)] = _retroTerminalEffect.value();
|
||||
}
|
||||
|
||||
root[JsonKey(AntialiasingModeKey)] = SerializeTextAntialiasingMode(_antialiasingMode).data();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - This generates a json object `diff` s.t.
|
||||
// this = other.LayerJson(diff)
|
||||
// So if:
|
||||
// - this has a nullopt for an optional, diff will have null for that member
|
||||
// - this has a value for an optional, diff will have our value. If the other
|
||||
// did _not_ have a value, and we did, diff will have our value.
|
||||
// Arguments:
|
||||
// - other: the other profile object to use as the "base" for this diff. The
|
||||
// result could be layered upon that json object to re-create this object's
|
||||
// serialization.
|
||||
// Return Value:
|
||||
// - a diff between this and the other object, such that this could be recreated
|
||||
// from the diff and the other object.
|
||||
Json::Value Profile::DiffToJson(const Profile& other) const
|
||||
{
|
||||
auto otherJson = other.ToJson();
|
||||
auto myJson = ToJson();
|
||||
Json::Value diff;
|
||||
|
||||
// Iterate in two steps:
|
||||
// - first over all the keys in the 'other' object's serialization.
|
||||
// - then over all the keys in our serialization.
|
||||
// In this way, we ensure all keys from both objects are present in the
|
||||
// final object.
|
||||
for (const auto& key : otherJson.getMemberNames())
|
||||
{
|
||||
if (myJson.isMember(key))
|
||||
{
|
||||
// Both objects have the key
|
||||
auto otherVal = otherJson[key];
|
||||
auto myVal = myJson[key];
|
||||
if (otherVal != myVal)
|
||||
{
|
||||
diff[key] = myVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// key is not in this json object. Set to null, so that when the
|
||||
// diff is layered upon the original object, we'll properly set
|
||||
// nullopt for any optionals that weren't present in this object.
|
||||
diff[key] = Json::Value::null;
|
||||
}
|
||||
}
|
||||
for (const auto& key : myJson.getMemberNames())
|
||||
{
|
||||
if (otherJson.isMember(key))
|
||||
{
|
||||
// both objects have this key. Do nothing, this is handled above
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a key the other object did not. Add our value.
|
||||
diff[key] = myJson[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Generates a Json::Value which is a "stub" of this profile. This stub will
|
||||
// have enough information that it could be layered with this profile.
|
||||
@@ -409,7 +568,7 @@ bool Profile::ShouldBeLayered(const Json::Value& json) const
|
||||
// - json: the Json::Value object to parse.
|
||||
// Return Value:
|
||||
// - An appropriate value from Windows.UI.Xaml.Media.Stretch
|
||||
Media::Stretch Profile::_ConvertJsonToStretchMode(const Json::Value& json)
|
||||
ImageStretchMode Profile::_ConvertJsonToStretchMode(const Json::Value& json)
|
||||
{
|
||||
return Profile::ParseImageStretchMode(json.asString());
|
||||
}
|
||||
@@ -493,12 +652,6 @@ void Profile::LayerJson(const Json::Value& json)
|
||||
|
||||
JsonUtils::GetInt(json, FontSizeKey, _fontSize);
|
||||
|
||||
if (json.isMember(JsonKey(FontWeightKey)))
|
||||
{
|
||||
auto fontWeight{ json[JsonKey(FontWeightKey)] };
|
||||
_fontWeight = _ParseFontWeight(fontWeight);
|
||||
}
|
||||
|
||||
JsonUtils::GetDouble(json, AcrylicTransparencyKey, _acrylicTransparency);
|
||||
|
||||
JsonUtils::GetBool(json, UseAcrylicKey, _useAcrylic);
|
||||
@@ -576,17 +729,17 @@ void Profile::SetUseAcrylic(bool useAcrylic) noexcept
|
||||
_useAcrylic = useAcrylic;
|
||||
}
|
||||
|
||||
void Profile::SetDefaultForeground(til::color defaultForeground) noexcept
|
||||
void Profile::SetDefaultForeground(COLORREF defaultForeground) noexcept
|
||||
{
|
||||
_defaultForeground = defaultForeground;
|
||||
}
|
||||
|
||||
void Profile::SetDefaultBackground(til::color defaultBackground) noexcept
|
||||
void Profile::SetDefaultBackground(COLORREF defaultBackground) noexcept
|
||||
{
|
||||
_defaultBackground = defaultBackground;
|
||||
}
|
||||
|
||||
void Profile::SetSelectionBackground(til::color selectionBackground) noexcept
|
||||
void Profile::SetSelectionBackground(COLORREF selectionBackground) noexcept
|
||||
{
|
||||
_selectionBackground = selectionBackground;
|
||||
}
|
||||
@@ -765,78 +918,6 @@ std::wstring Profile::EvaluateStartingDirectory(const std::wstring& directory)
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper function for converting a user-specified font weight value to its corresponding enum
|
||||
// Arguments:
|
||||
// - The value from the settings.json file
|
||||
// Return Value:
|
||||
// - The corresponding value which maps to the string provided by the user
|
||||
winrt::Windows::UI::Text::FontWeight Profile::_ParseFontWeight(const Json::Value& json)
|
||||
{
|
||||
if (json.isUInt())
|
||||
{
|
||||
winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = static_cast<uint16_t>(json.asUInt());
|
||||
|
||||
// We're only accepting variable values between 100 and 990 so we don't go too crazy.
|
||||
if (weight.Weight >= 100 && weight.Weight <= 990)
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
}
|
||||
|
||||
if (json.isString())
|
||||
{
|
||||
auto fontWeight = json.asString();
|
||||
if (fontWeight == FontWeightThin)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Thin();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraLight();
|
||||
}
|
||||
else if (fontWeight == FontWeightLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Light();
|
||||
}
|
||||
else if (fontWeight == FontWeightSemiLight)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::SemiLight();
|
||||
}
|
||||
else if (fontWeight == FontWeightNormal)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Normal();
|
||||
}
|
||||
else if (fontWeight == FontWeightMedium)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Medium();
|
||||
}
|
||||
else if (fontWeight == FontWeightSemiBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::SemiBold();
|
||||
}
|
||||
else if (fontWeight == FontWeightBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Bold();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraBold)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraBold();
|
||||
}
|
||||
else if (fontWeight == FontWeightBlack)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::Black();
|
||||
}
|
||||
else if (fontWeight == FontWeightExtraBlack)
|
||||
{
|
||||
return winrt::Windows::UI::Text::FontWeights::ExtraBlack();
|
||||
}
|
||||
}
|
||||
|
||||
return winrt::Windows::UI::Text::FontWeights::Normal();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Helper function for converting a user-specified closeOnExit value to its corresponding enum
|
||||
// Arguments:
|
||||
@@ -920,23 +1001,27 @@ ScrollbarState Profile::ParseScrollbarState(const std::wstring& scrollbarState)
|
||||
// - The value from the settings.json file
|
||||
// Return Value:
|
||||
// - The corresponding enum value which maps to the string provided by the user
|
||||
Media::Stretch Profile::ParseImageStretchMode(const std::string_view imageStretchMode)
|
||||
ImageStretchMode Profile::ParseImageStretchMode(const std::string_view imageStretchMode)
|
||||
{
|
||||
if (imageStretchMode == ImageStretchModeNone)
|
||||
{
|
||||
return Media::Stretch::None;
|
||||
return ImageStretchMode::None;
|
||||
}
|
||||
else if (imageStretchMode == ImageStretchModeFill)
|
||||
{
|
||||
return Media::Stretch::Fill;
|
||||
return ImageStretchMode::Fill;
|
||||
}
|
||||
else if (imageStretchMode == ImageStretchModeUniform)
|
||||
{
|
||||
return Media::Stretch::Uniform;
|
||||
return ImageStretchMode::Uniform;
|
||||
}
|
||||
else if (imageStretchMode == ImageStretchModeTile)
|
||||
{
|
||||
return ImageStretchMode::Tile;
|
||||
}
|
||||
else // Fall through to default behavior
|
||||
{
|
||||
return Media::Stretch::UniformToFill;
|
||||
return ImageStretchMode::UniformToFill;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -947,18 +1032,20 @@ Media::Stretch Profile::ParseImageStretchMode(const std::string_view imageStretc
|
||||
// - imageStretchMode: The enum value to convert to a string.
|
||||
// Return Value:
|
||||
// - The string value for the given ImageStretchMode
|
||||
std::string_view Profile::SerializeImageStretchMode(const Media::Stretch imageStretchMode)
|
||||
std::string_view Profile::SerializeImageStretchMode(const ImageStretchMode imageStretchMode)
|
||||
{
|
||||
switch (imageStretchMode)
|
||||
{
|
||||
case Media::Stretch::None:
|
||||
case ImageStretchMode::None:
|
||||
return ImageStretchModeNone;
|
||||
case Media::Stretch::Fill:
|
||||
case ImageStretchMode::Fill:
|
||||
return ImageStretchModeFill;
|
||||
case Media::Stretch::Uniform:
|
||||
case ImageStretchMode::Uniform:
|
||||
return ImageStretchModeUniform;
|
||||
case ImageStretchMode::Tile:
|
||||
return ImageStretchModeTile;
|
||||
default:
|
||||
case Media::Stretch::UniformToFill:
|
||||
case ImageStretchMode::UniformToFill:
|
||||
return ImageStretchModeUniformTofill;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ public:
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::TerminalSettings CreateTerminalSettings(const std::unordered_map<std::wstring, ColorScheme>& schemes) const;
|
||||
|
||||
Json::Value ToJson() const;
|
||||
Json::Value DiffToJson(const Profile& other) const;
|
||||
Json::Value GenerateStub() const;
|
||||
static Profile FromJson(const Json::Value& json);
|
||||
bool ShouldBeLayered(const Json::Value& json) const;
|
||||
@@ -79,9 +81,9 @@ public:
|
||||
void SetStartingDirectory(std::wstring startingDirectory) noexcept;
|
||||
void SetName(const std::wstring_view name) noexcept;
|
||||
void SetUseAcrylic(bool useAcrylic) noexcept;
|
||||
void SetDefaultForeground(til::color defaultForeground) noexcept;
|
||||
void SetDefaultBackground(til::color defaultBackground) noexcept;
|
||||
void SetSelectionBackground(til::color selectionBackground) noexcept;
|
||||
void SetDefaultForeground(COLORREF defaultForeground) noexcept;
|
||||
void SetDefaultBackground(COLORREF defaultBackground) noexcept;
|
||||
void SetSelectionBackground(COLORREF selectionBackground) noexcept;
|
||||
void SetCloseOnExitMode(CloseOnExitMode mode) noexcept;
|
||||
void SetConnectionType(GUID connectionType) noexcept;
|
||||
|
||||
@@ -108,14 +110,12 @@ private:
|
||||
static std::wstring EvaluateStartingDirectory(const std::wstring& directory);
|
||||
|
||||
static winrt::Microsoft::Terminal::Settings::ScrollbarState ParseScrollbarState(const std::wstring& scrollbarState);
|
||||
static winrt::Windows::UI::Xaml::Media::Stretch ParseImageStretchMode(const std::string_view imageStretchMode);
|
||||
static winrt::Windows::UI::Xaml::Media::Stretch _ConvertJsonToStretchMode(const Json::Value& json);
|
||||
static std::string_view SerializeImageStretchMode(const winrt::Windows::UI::Xaml::Media::Stretch imageStretchMode);
|
||||
static winrt::Microsoft::Terminal::Settings::ImageStretchMode ParseImageStretchMode(const std::string_view imageStretchMode);
|
||||
static winrt::Microsoft::Terminal::Settings::ImageStretchMode _ConvertJsonToStretchMode(const Json::Value& json);
|
||||
static std::string_view SerializeImageStretchMode(const winrt::Microsoft::Terminal::Settings::ImageStretchMode imageStretchMode);
|
||||
static std::tuple<winrt::Windows::UI::Xaml::HorizontalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment> ParseImageAlignment(const std::string_view imageAlignment);
|
||||
static std::tuple<winrt::Windows::UI::Xaml::HorizontalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment> _ConvertJsonToAlignment(const Json::Value& json);
|
||||
|
||||
static winrt::Windows::UI::Text::FontWeight _ParseFontWeight(const Json::Value& json);
|
||||
|
||||
static CloseOnExitMode ParseCloseOnExitMode(const Json::Value& json);
|
||||
static std::string_view _SerializeCloseOnExitMode(const CloseOnExitMode closeOnExitMode);
|
||||
|
||||
@@ -139,10 +139,10 @@ private:
|
||||
// If this is set, then our colors should come from the associated color scheme
|
||||
std::optional<std::wstring> _schemeName;
|
||||
|
||||
std::optional<til::color> _defaultForeground;
|
||||
std::optional<til::color> _defaultBackground;
|
||||
std::optional<til::color> _selectionBackground;
|
||||
std::optional<til::color> _cursorColor;
|
||||
std::optional<uint32_t> _defaultForeground;
|
||||
std::optional<uint32_t> _defaultBackground;
|
||||
std::optional<uint32_t> _selectionBackground;
|
||||
std::optional<uint32_t> _cursorColor;
|
||||
std::optional<std::wstring> _tabTitle;
|
||||
bool _suppressApplicationTitle;
|
||||
int32_t _historySize;
|
||||
@@ -154,13 +154,12 @@ private:
|
||||
std::wstring _fontFace;
|
||||
std::optional<std::wstring> _startingDirectory;
|
||||
int32_t _fontSize;
|
||||
winrt::Windows::UI::Text::FontWeight _fontWeight;
|
||||
double _acrylicTransparency;
|
||||
bool _useAcrylic;
|
||||
|
||||
std::optional<std::wstring> _backgroundImage;
|
||||
std::optional<double> _backgroundImageOpacity;
|
||||
std::optional<winrt::Windows::UI::Xaml::Media::Stretch> _backgroundImageStretchMode;
|
||||
std::optional<winrt::Microsoft::Terminal::Settings::ImageStretchMode> _backgroundImageStretchMode;
|
||||
std::optional<std::tuple<winrt::Windows::UI::Xaml::HorizontalAlignment, winrt::Windows::UI::Xaml::VerticalAlignment>> _backgroundImageAlignment;
|
||||
|
||||
std::optional<std::wstring> _scrollbarState;
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
somehow. So make sure to only include top-level dependencies here (don't
|
||||
include Settings and Connection, since Control will include them for us) -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <LibraryResources.h>
|
||||
|
||||
#include "TerminalPage.g.cpp"
|
||||
#include <winrt/Windows.Storage.h>
|
||||
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
|
||||
|
||||
#include "AzureCloudShellGenerator.h" // For AzureConnectionType
|
||||
@@ -20,8 +19,6 @@
|
||||
#include "ColorHelper.h"
|
||||
#include "DebugTapConnection.h"
|
||||
|
||||
#include <winrt/Microsoft.Terminal.Settings.Control.h>
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
@@ -857,17 +854,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
_lastTabClosedHandlers(*this, nullptr);
|
||||
}
|
||||
else if (_isFullscreen || _rearranging)
|
||||
else if (_isFullscreen)
|
||||
{
|
||||
// GH#5799 - If we're fullscreen, the TabView isn't visible. If it's
|
||||
// not Visible, it's _not_ going to raise a SelectionChanged event,
|
||||
// which is what we usually use to focus another tab. Instead, we'll
|
||||
// have to do it manually here.
|
||||
//
|
||||
// GH#5559 Similarly, we suppress _OnTabItemsChanged events during a
|
||||
// rearrange, so if a tab is closed while we're rearranging tabs, do
|
||||
// this manually.
|
||||
//
|
||||
// We can't use
|
||||
// auto selectedIndex = _tabView.SelectedIndex();
|
||||
// Because this will always return -1 in this scenario unfortunately.
|
||||
@@ -892,15 +885,6 @@ namespace winrt::TerminalApp::implementation
|
||||
auto newSelectedTab{ _GetStrongTabImpl(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab->GetTabViewItem());
|
||||
}
|
||||
|
||||
// GH#5559 - If we were in the middle of a drag/drop, end it by clearing
|
||||
// out our state.
|
||||
if (_rearranging)
|
||||
{
|
||||
_rearranging = false;
|
||||
_rearrangeFrom = std::nullopt;
|
||||
_rearrangeTo = std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1471,16 +1455,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
text = co_await data.GetTextAsync();
|
||||
}
|
||||
// Windows Explorer's "Copy address" menu item stores a StorageItem in the clipboard, and no text.
|
||||
else if (data.Contains(StandardDataFormats::StorageItems()))
|
||||
{
|
||||
Windows::Foundation::Collections::IVectorView<Windows::Storage::IStorageItem> items = co_await data.GetStorageItemsAsync();
|
||||
if (items.Size() > 0)
|
||||
{
|
||||
Windows::Storage::IStorageItem item = items.GetAt(0);
|
||||
text = item.Path();
|
||||
}
|
||||
}
|
||||
eventArgs.HandleClipboardData(text);
|
||||
}
|
||||
CATCH_LOG();
|
||||
@@ -1512,29 +1486,20 @@ namespace winrt::TerminalApp::implementation
|
||||
// a background thread, as to not hang/crash the UI thread.
|
||||
fire_and_forget TerminalPage::_LaunchSettings(const bool openDefaults)
|
||||
{
|
||||
openDefaults;
|
||||
// This will switch the execution of the function to a background (not
|
||||
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
|
||||
// (used for retrieving the path to the file) will crash on the UI
|
||||
// thread, because the main thread is a STA.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
auto settingsPage = winrt::make_self<::winrt::Microsoft::Terminal::Settings::Control::MainPage>();
|
||||
auto tabViewItem = ::winrt::MUX::Controls::TabViewItem{};
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
_tabView.SelectedItem(settingsPage);
|
||||
const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
|
||||
CascadiaSettings::GetSettingsPath();
|
||||
|
||||
|
||||
|
||||
//// This will switch the execution of the function to a background (not
|
||||
//// UI) thread. This is IMPORTANT, because the Windows.Storage API's
|
||||
//// (used for retrieving the path to the file) will crash on the UI
|
||||
//// thread, because the main thread is a STA.
|
||||
//co_await winrt::resume_background();
|
||||
|
||||
//const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
|
||||
// CascadiaSettings::GetSettingsPath();
|
||||
|
||||
//HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
//if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
//{
|
||||
// ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
|
||||
//}
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -274,12 +274,6 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Control">
|
||||
<HintPath>$(_BinRoot)TerminalSettingsControl\Microsoft.Terminal.Settings.Control.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(_BinRoot)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
|
||||
@@ -201,7 +201,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// things in DIPs, and the fontSize is in pixels.
|
||||
TextBlock().FontSize(unscaledFontSizePx);
|
||||
TextBlock().FontFamily(Media::FontFamily(fontArgs->FontFace()));
|
||||
TextBlock().FontWeight(fontArgs->FontWeight());
|
||||
|
||||
// TextBlock's actual dimensions right after initialization is 0w x 0h. So,
|
||||
// if an IME is displayed before TextBlock has text (like showing the emoji picker
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
GETSET_PROPERTY(Windows::Foundation::Size, FontSize);
|
||||
|
||||
GETSET_PROPERTY(winrt::hstring, FontFace);
|
||||
|
||||
GETSET_PROPERTY(Windows::UI::Text::FontWeight, FontWeight);
|
||||
};
|
||||
|
||||
struct TSFInputControl : TSFInputControlT<TSFInputControl>
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace Microsoft.Terminal.TerminalControl
|
||||
{
|
||||
String FontFace { get; set; };
|
||||
Windows.Foundation.Size FontSize { get; set; };
|
||||
Windows.UI.Text.FontWeight FontWeight { get; set; };
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
_autoScrollingPointerPoint{ std::nullopt },
|
||||
_autoScrollTimer{},
|
||||
_lastAutoScrollUpdateTime{ std::nullopt },
|
||||
_desiredFont{ DEFAULT_FONT_FACE, 0, DEFAULT_FONT_WEIGHT, { 0, DEFAULT_FONT_SIZE }, CP_UTF8 },
|
||||
_actualFont{ DEFAULT_FONT_FACE, 0, DEFAULT_FONT_WEIGHT, { 0, DEFAULT_FONT_SIZE }, CP_UTF8, false },
|
||||
_desiredFont{ DEFAULT_FONT_FACE, 0, 10, { 0, DEFAULT_FONT_SIZE }, CP_UTF8 },
|
||||
_actualFont{ DEFAULT_FONT_FACE, 0, 10, { 0, DEFAULT_FONT_SIZE }, CP_UTF8, false },
|
||||
_touchAnchor{ std::nullopt },
|
||||
_cursorTimer{},
|
||||
_lastMouseClickTimestamp{},
|
||||
@@ -253,7 +253,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
_InitializeBackgroundBrush();
|
||||
|
||||
COLORREF bg = _settings.DefaultBackground();
|
||||
uint32_t bg = _settings.DefaultBackground();
|
||||
_BackgroundColorChanged(bg);
|
||||
|
||||
// Apply padding as swapChainPanel's margin
|
||||
@@ -263,19 +263,18 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Initialize our font information.
|
||||
const auto fontFace = _settings.FontFace();
|
||||
const short fontHeight = gsl::narrow_cast<short>(_settings.FontSize());
|
||||
const auto fontWeight = _settings.FontWeight();
|
||||
// The font width doesn't terribly matter, we'll only be using the
|
||||
// height to look it up
|
||||
// The other params here also largely don't matter.
|
||||
// The family is only used to determine if the font is truetype or
|
||||
// not, but DX doesn't use that info at all.
|
||||
// The Codepage is additionally not actually used by the DX engine at all.
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, fontHeight }, CP_UTF8, false };
|
||||
_actualFont = { fontFace, 0, 10, { 0, fontHeight }, CP_UTF8, false };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
// set TSF Foreground
|
||||
Media::SolidColorBrush foregroundBrush{};
|
||||
foregroundBrush.Color(static_cast<til::color>(_settings.DefaultForeground()));
|
||||
foregroundBrush.Color(ColorRefToColor(_settings.DefaultForeground()));
|
||||
TSFInputControl().Foreground(foregroundBrush);
|
||||
TSFInputControl().Margin(newMargin);
|
||||
|
||||
@@ -374,7 +373,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Check if the image brush is already pointing to the image
|
||||
// in the modified settings; if it isn't (or isn't there),
|
||||
// set a new image source for the brush
|
||||
auto imageSource = BackgroundImage().Source().try_as<Media::Imaging::BitmapImage>();
|
||||
auto imageSource = _backgroundImageBrush.ImageSource().try_as<Media::Imaging::BitmapImage>();
|
||||
|
||||
if (imageSource == nullptr ||
|
||||
imageSource.UriSource() == nullptr ||
|
||||
@@ -385,18 +384,32 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// may well be both large and somewhere out on the
|
||||
// internet.
|
||||
Media::Imaging::BitmapImage image(imageUri);
|
||||
BackgroundImage().Source(image);
|
||||
_backgroundImageBrush.ImageSource(image);
|
||||
}
|
||||
|
||||
// Apply stretch, opacity and alignment settings
|
||||
BackgroundImage().Stretch(_settings.BackgroundImageStretchMode());
|
||||
BackgroundImage().Opacity(_settings.BackgroundImageOpacity());
|
||||
BackgroundImage().HorizontalAlignment(_settings.BackgroundImageHorizontalAlignment());
|
||||
BackgroundImage().VerticalAlignment(_settings.BackgroundImageVerticalAlignment());
|
||||
switch (_settings.BackgroundImageStretchMode())
|
||||
{
|
||||
case Settings::ImageStretchMode::Tile:
|
||||
THROW_HR(E_NOTIMPL);
|
||||
break;
|
||||
default:
|
||||
case Settings::ImageStretchMode::None:
|
||||
case Settings::ImageStretchMode::Fill:
|
||||
case Settings::ImageStretchMode::Uniform:
|
||||
case Settings::ImageStretchMode::UniformToFill:
|
||||
_backgroundImageBrush.Stretch(static_cast<Media::Stretch>(_settings.BackgroundImageStretchMode()));
|
||||
_backgroundImageBrush.AlignmentX(static_cast<Media::AlignmentX>(_settings.BackgroundImageHorizontalAlignment()));
|
||||
_backgroundImageBrush.AlignmentY(static_cast<Media::AlignmentY>(_settings.BackgroundImageVerticalAlignment()));
|
||||
BackgroundImage().Background(_backgroundImageBrush);
|
||||
break;
|
||||
}
|
||||
_backgroundImageBrush.Opacity(_settings.BackgroundImageOpacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundImage().Source(nullptr);
|
||||
BackgroundImage().Background(nullptr);
|
||||
_backgroundImageBrush = {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,29 +419,37 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - color: The background color to use as a uint32 (aka DWORD COLORREF)
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TermControl::_BackgroundColorChanged(const COLORREF color)
|
||||
winrt::fire_and_forget TermControl::_BackgroundColorChanged(const uint32_t color)
|
||||
{
|
||||
til::color newBgColor{ color };
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
if (auto control{ weakThis.get() })
|
||||
{
|
||||
const auto R = GetRValue(color);
|
||||
const auto G = GetGValue(color);
|
||||
const auto B = GetBValue(color);
|
||||
|
||||
winrt::Windows::UI::Color bgColor{};
|
||||
bgColor.R = R;
|
||||
bgColor.G = G;
|
||||
bgColor.B = B;
|
||||
bgColor.A = 255;
|
||||
|
||||
if (auto acrylic = RootGrid().Background().try_as<Media::AcrylicBrush>())
|
||||
{
|
||||
acrylic.FallbackColor(newBgColor);
|
||||
acrylic.TintColor(newBgColor);
|
||||
acrylic.FallbackColor(bgColor);
|
||||
acrylic.TintColor(bgColor);
|
||||
}
|
||||
else if (auto solidColor = RootGrid().Background().try_as<Media::SolidColorBrush>())
|
||||
{
|
||||
solidColor.Color(newBgColor);
|
||||
solidColor.Color(bgColor);
|
||||
}
|
||||
|
||||
// Set the default background as transparent to prevent the
|
||||
// DX layer from overwriting the background image or acrylic effect
|
||||
_settings.DefaultBackground(static_cast<COLORREF>(newBgColor.with_alpha(0)));
|
||||
_settings.DefaultBackground(ARGB(0, R, G, B));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1302,7 +1323,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
_settings.UseAcrylic(false);
|
||||
_InitializeBackgroundBrush();
|
||||
COLORREF bg = _settings.DefaultBackground();
|
||||
uint32_t bg = _settings.DefaultBackground();
|
||||
_BackgroundColorChanged(bg);
|
||||
}
|
||||
else
|
||||
@@ -1679,8 +1700,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Make sure we have a non-zero font size
|
||||
const auto newSize = std::max<short>(gsl::narrow_cast<short>(fontSize), 1);
|
||||
const auto fontFace = _settings.FontFace();
|
||||
const auto fontWeight = _settings.FontWeight();
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, { 0, newSize }, CP_UTF8, false };
|
||||
_actualFont = { fontFace, 0, 10, { 0, newSize }, CP_UTF8, false };
|
||||
_desiredFont = { _actualFont };
|
||||
|
||||
auto lock = _terminal->LockForWriting();
|
||||
@@ -2199,14 +2219,13 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// Initialize our font information.
|
||||
const auto fontFace = settings.FontFace();
|
||||
const short fontHeight = gsl::narrow_cast<short>(settings.FontSize());
|
||||
const auto fontWeight = settings.FontWeight();
|
||||
// The font width doesn't terribly matter, we'll only be using the
|
||||
// height to look it up
|
||||
// The other params here also largely don't matter.
|
||||
// The family is only used to determine if the font is truetype or
|
||||
// not, but DX doesn't use that info at all.
|
||||
// The Codepage is additionally not actually used by the DX engine at all.
|
||||
FontInfo actualFont = { fontFace, 0, fontWeight.Weight, { 0, fontHeight }, CP_UTF8, false };
|
||||
FontInfo actualFont = { fontFace, 0, 10, { 0, fontHeight }, CP_UTF8, false };
|
||||
FontInfoDesired desiredFont = { actualFont };
|
||||
|
||||
// If the settings have negative or zero row or column counts, ignore those counts.
|
||||
@@ -2500,9 +2519,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
{
|
||||
eventArgs.FontSize(CharacterDimensions());
|
||||
eventArgs.FontFace(_actualFont.GetFaceName());
|
||||
::winrt::Windows::UI::Text::FontWeight weight;
|
||||
weight.Weight = static_cast<uint16_t>(_actualFont.GetWeight());
|
||||
eventArgs.FontWeight(weight);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -169,12 +169,13 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// from firing when the pointer _just happens_ to be released over the
|
||||
// terminal.
|
||||
bool _selectionNeedsToBeCopied;
|
||||
Windows::UI::Xaml::Media::ImageBrush _backgroundImageBrush;
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::SwapChainPanel::LayoutUpdated_revoker _layoutUpdatedRevoker;
|
||||
|
||||
void _ApplyUISettings();
|
||||
void _InitializeBackgroundBrush();
|
||||
winrt::fire_and_forget _BackgroundColorChanged(const COLORREF color);
|
||||
winrt::fire_and_forget _BackgroundColorChanged(const uint32_t color);
|
||||
bool _InitializeTerminal();
|
||||
void _UpdateFont(const bool initialUpdate = false);
|
||||
void _SetFontSize(int fontSize);
|
||||
|
||||
@@ -29,31 +29,30 @@
|
||||
-->
|
||||
|
||||
<Grid x:Name="RootGrid">
|
||||
<Image x:Name="BackgroundImage"
|
||||
AutomationProperties.AccessibilityView="Raw" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Grid.Column="0">
|
||||
<SwapChainPanel x:Name="SwapChainPanel"
|
||||
SizeChanged="_SwapChainSizeChanged"
|
||||
CompositionScaleChanged="_SwapChainScaleChanged"
|
||||
PointerPressed="_PointerPressedHandler"
|
||||
PointerMoved="_PointerMovedHandler"
|
||||
PointerReleased="_PointerReleasedHandler" />
|
||||
|
||||
<!-- Putting this in a grid w/ the SwapChainPanel
|
||||
ensures that it's always aligned w/ the scrollbar -->
|
||||
<local:SearchBoxControl x:Name="SearchBox"
|
||||
x:Load="False"
|
||||
Visibility="Collapsed"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Search="_Search"
|
||||
Closed="_CloseSearchBoxControl" />
|
||||
<Grid x:Name="BackgroundImage"
|
||||
Grid.Column="0">
|
||||
<SwapChainPanel x:Name="SwapChainPanel"
|
||||
SizeChanged="_SwapChainSizeChanged"
|
||||
CompositionScaleChanged="_SwapChainScaleChanged"
|
||||
PointerPressed="_PointerPressedHandler"
|
||||
PointerMoved="_PointerMovedHandler"
|
||||
PointerReleased="_PointerReleasedHandler" />
|
||||
|
||||
<!-- Putting this in a grid w/ the SwapChainPanel
|
||||
ensures that it's always aligned w/ the scrollbar -->
|
||||
<local:SearchBoxControl x:Name="SearchBox"
|
||||
x:Load="False"
|
||||
Visibility="Collapsed"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Search="_Search"
|
||||
Closed="_CloseSearchBoxControl" />
|
||||
</Grid>
|
||||
|
||||
<ScrollBar Grid.Column="1"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
Microsoft namespace. This is, obviously, not great. None of our other
|
||||
projects compile properly when they depend on this "Microsoft.winmd."
|
||||
-->
|
||||
<CppWinRTNamespaceMergeDepth>4</CppWinRTNamespaceMergeDepth>
|
||||
<CppWinRTNamespaceMergeDepth>3</CppWinRTNamespaceMergeDepth>
|
||||
|
||||
<!--
|
||||
DON'T REDIRECT OUR OUTPUT.
|
||||
|
||||
@@ -875,7 +875,7 @@ void Terminal::SetCursorPositionChangedCallback(std::function<void()> pfn) noexc
|
||||
// - Allows setting a callback for when the background color is changed
|
||||
// Arguments:
|
||||
// - pfn: a function callback that takes a uint32 (DWORD COLORREF) color in the format 0x00BBGGRR
|
||||
void Terminal::SetBackgroundCallback(std::function<void(const COLORREF)> pfn) noexcept
|
||||
void Terminal::SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept
|
||||
{
|
||||
_pfnBackgroundColorChanged.swap(pfn);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
void SetTitleChangedCallback(std::function<void(const std::wstring_view&)> pfn) noexcept;
|
||||
void SetScrollPositionChangedCallback(std::function<void(const int, const int, const int)> pfn) noexcept;
|
||||
void SetCursorPositionChangedCallback(std::function<void()> pfn) noexcept;
|
||||
void SetBackgroundCallback(std::function<void(const COLORREF)> pfn) noexcept;
|
||||
void SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept;
|
||||
|
||||
void SetCursorOn(const bool isOn);
|
||||
bool IsCursorBlinkingAllowed() const noexcept;
|
||||
@@ -196,7 +196,7 @@ private:
|
||||
std::function<void(std::wstring&)> _pfnWriteInput;
|
||||
std::function<void(const std::wstring_view&)> _pfnTitleChanged;
|
||||
std::function<void(const int, const int, const int)> _pfnScrollPositionChanged;
|
||||
std::function<void(const COLORREF)> _pfnBackgroundColorChanged;
|
||||
std::function<void(const uint32_t)> _pfnBackgroundColorChanged;
|
||||
std::function<void()> _pfnCursorPositionChanged;
|
||||
|
||||
std::unique_ptr<::Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
|
||||
|
||||
@@ -19,6 +19,15 @@ namespace Microsoft.Terminal.Settings
|
||||
Aliased
|
||||
};
|
||||
|
||||
enum ImageStretchMode
|
||||
{
|
||||
None = 0,
|
||||
Fill,
|
||||
Uniform,
|
||||
UniformToFill,
|
||||
Tile
|
||||
};
|
||||
|
||||
// Class Description:
|
||||
// TerminalSettings encapsulates all settings that control the
|
||||
// TermControl's behavior. In these settings there is both the entirety
|
||||
@@ -34,7 +43,6 @@ namespace Microsoft.Terminal.Settings
|
||||
|
||||
String FontFace;
|
||||
Int32 FontSize;
|
||||
Windows.UI.Text.FontWeight FontWeight;
|
||||
String Padding;
|
||||
|
||||
IKeyBindings KeyBindings;
|
||||
@@ -47,7 +55,7 @@ namespace Microsoft.Terminal.Settings
|
||||
|
||||
String BackgroundImage;
|
||||
Double BackgroundImageOpacity;
|
||||
Windows.UI.Xaml.Media.Stretch BackgroundImageStretchMode;
|
||||
ImageStretchMode BackgroundImageStretchMode;
|
||||
Windows.UI.Xaml.HorizontalAlignment BackgroundImageHorizontalAlignment;
|
||||
Windows.UI.Xaml.VerticalAlignment BackgroundImageVerticalAlignment;
|
||||
|
||||
|
||||
@@ -34,10 +34,9 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
_padding{ DEFAULT_PADDING },
|
||||
_fontFace{ DEFAULT_FONT_FACE },
|
||||
_fontSize{ DEFAULT_FONT_SIZE },
|
||||
_fontWeight{ DEFAULT_FONT_WEIGHT },
|
||||
_backgroundImage{},
|
||||
_backgroundImageOpacity{ 1.0 },
|
||||
_backgroundImageStretchMode{ winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill },
|
||||
_backgroundImageStretchMode{ ImageStretchMode::UniformToFill },
|
||||
_backgroundImageHorizontalAlignment{ winrt::Windows::UI::Xaml::HorizontalAlignment::Center },
|
||||
_backgroundImageVerticalAlignment{ winrt::Windows::UI::Xaml::VerticalAlignment::Center },
|
||||
_keyBindings{ nullptr },
|
||||
@@ -259,16 +258,6 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
_fontSize = value;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Text::FontWeight TerminalSettings::FontWeight() noexcept
|
||||
{
|
||||
return _fontWeight;
|
||||
}
|
||||
|
||||
void TerminalSettings::FontWeight(winrt::Windows::UI::Text::FontWeight value) noexcept
|
||||
{
|
||||
_fontWeight = value;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImage(hstring const& value)
|
||||
{
|
||||
_backgroundImage = value;
|
||||
@@ -289,12 +278,12 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
return _backgroundImageOpacity;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Xaml::Media::Stretch TerminalSettings::BackgroundImageStretchMode() noexcept
|
||||
ImageStretchMode TerminalSettings::BackgroundImageStretchMode() noexcept
|
||||
{
|
||||
return _backgroundImageStretchMode;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImageStretchMode(winrt::Windows::UI::Xaml::Media::Stretch value) noexcept
|
||||
void TerminalSettings::BackgroundImageStretchMode(ImageStretchMode value) noexcept
|
||||
{
|
||||
_backgroundImageStretchMode = value;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
uint32_t CursorColor() noexcept;
|
||||
void CursorColor(uint32_t value) noexcept;
|
||||
CursorStyle CursorShape() const noexcept;
|
||||
void CursorShape(winrt::Microsoft::Terminal::Settings::CursorStyle const& value) noexcept;
|
||||
void CursorShape(CursorStyle const& value) noexcept;
|
||||
uint32_t CursorHeight() noexcept;
|
||||
void CursorHeight(uint32_t value) noexcept;
|
||||
hstring WordDelimiters();
|
||||
@@ -68,15 +68,13 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
void FontFace(hstring const& value);
|
||||
int32_t FontSize() noexcept;
|
||||
void FontSize(int32_t value) noexcept;
|
||||
winrt::Windows::UI::Text::FontWeight FontWeight() noexcept;
|
||||
void FontWeight(winrt::Windows::UI::Text::FontWeight value) noexcept;
|
||||
|
||||
hstring BackgroundImage();
|
||||
void BackgroundImage(hstring const& value);
|
||||
double BackgroundImageOpacity() noexcept;
|
||||
void BackgroundImageOpacity(double value) noexcept;
|
||||
winrt::Windows::UI::Xaml::Media::Stretch BackgroundImageStretchMode() noexcept;
|
||||
void BackgroundImageStretchMode(winrt::Windows::UI::Xaml::Media::Stretch value) noexcept;
|
||||
ImageStretchMode BackgroundImageStretchMode() noexcept;
|
||||
void BackgroundImageStretchMode(ImageStretchMode value) noexcept;
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment BackgroundImageHorizontalAlignment() noexcept;
|
||||
void BackgroundImageHorizontalAlignment(winrt::Windows::UI::Xaml::HorizontalAlignment value) noexcept;
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment BackgroundImageVerticalAlignment() noexcept;
|
||||
@@ -135,11 +133,10 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
double _tintOpacity;
|
||||
hstring _fontFace;
|
||||
int32_t _fontSize;
|
||||
winrt::Windows::UI::Text::FontWeight _fontWeight;
|
||||
hstring _padding;
|
||||
hstring _backgroundImage;
|
||||
double _backgroundImageOpacity;
|
||||
winrt::Windows::UI::Xaml::Media::Stretch _backgroundImageStretchMode;
|
||||
Settings::ImageStretchMode _backgroundImageStretchMode;
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment _backgroundImageHorizontalAlignment;
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment _backgroundImageVerticalAlignment;
|
||||
bool _copyOnSelect;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "ColorSchemes.h"
|
||||
#if __has_include("ColorSchemes.g.cpp")
|
||||
#include "ColorSchemes.g.cpp"
|
||||
#endif
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
ColorSchemes::ColorSchemes()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
int32_t ColorSchemes::MyProperty()
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void ColorSchemes::MyProperty(int32_t /* value */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void ColorSchemes::ClickHandler(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
//Button().Content(box_value(L"Clicked"));
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "ColorSchemes.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
struct ColorSchemes : ColorSchemesT<ColorSchemes>
|
||||
{
|
||||
ColorSchemes();
|
||||
|
||||
int32_t MyProperty();
|
||||
void MyProperty(int32_t value);
|
||||
|
||||
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
|
||||
{
|
||||
struct ColorSchemes : ColorSchemesT<ColorSchemes, implementation::ColorSchemes>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Control
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
ColorSchemes();
|
||||
Int32 MyProperty;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Control.ColorSchemes"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text="Color Schemes"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,8" />
|
||||
|
||||
<GridView x:Name="ProfilesGridView"
|
||||
Margin="0,0,0,8"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True"
|
||||
RelativePanel.Below="TitleTextBox">
|
||||
<GridView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
|
||||
MaximumRowsOrColumns="2"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</GridView.ItemsPanel>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (2).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (3).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (4).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (5).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (6).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalColorSchemes (7).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
</GridView>
|
||||
</RelativePanel>
|
||||
</Page>
|
||||
@@ -1,29 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Globals.h"
|
||||
#include "Globals.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
Globals::Globals()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
int32_t Globals::MyProperty()
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Globals::MyProperty(int32_t /* value */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Globals::ClickHandler(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Globals.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
struct Globals : GlobalsT<Globals>
|
||||
{
|
||||
Globals();
|
||||
|
||||
int32_t MyProperty();
|
||||
void MyProperty(int32_t value);
|
||||
|
||||
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
|
||||
{
|
||||
struct Globals : GlobalsT<Globals, implementation::Globals>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Control
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Globals : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Globals();
|
||||
Int32 MyProperty;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Control.Globals"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Control"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Globals"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,10" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBlock Text="Appearance"
|
||||
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Requested Theme" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="SystemTheme" Content="System"/>
|
||||
<RadioButton x:Name="DarkTheme" Content="Dark"/>
|
||||
<RadioButton x:Name="LightTheme" Content="Light"/>
|
||||
</Controls:RadioButtons>
|
||||
<Controls:RadioButtons Header="Launch mode" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="DefaultLaunchMode" Content="Default"/>
|
||||
<RadioButton x:Name="MaximizedLaunchMode" Content="Maximized"/>
|
||||
</Controls:RadioButtons>
|
||||
<RelativePanel Margin="0,0,0,10">
|
||||
<Controls:NumberBox x:Name="InitialCols"
|
||||
Header="Initial Columns"
|
||||
Value="120"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Margin="0,0,20,0"/>
|
||||
<Controls:NumberBox x:Name="InitialRows"
|
||||
Header="Initial Rows"
|
||||
Value="30"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Margin="0,0,20,0"
|
||||
RelativePanel.RightOf="InitialCols"/>
|
||||
<TextBox Header="Initial position"
|
||||
RelativePanel.RightOf="InitialRows"/>
|
||||
</RelativePanel>
|
||||
<CheckBox Content="Always show tabs" />
|
||||
<CheckBox Content="Show Terminal title in titlebar" />
|
||||
<CheckBox Content="Show tabs in titlebar" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Tab width mode">
|
||||
<RadioButton x:Name="EqualTabWidthMode" Content="Equal"/>
|
||||
<RadioButton x:Name="TitleLengthTabWidthMode" Content="Title length"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,100,0">
|
||||
<TextBlock Text="Interaction"
|
||||
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<TextBox Header="Default profile" Margin="0,0,0,10" />
|
||||
<TextBox Header="Word delimeters" Margin="0,0,0,10" />
|
||||
<CheckBox Content="Confirm close all tabs" />
|
||||
<CheckBox Content="Copy on select" />
|
||||
<CheckBox Content="Snap to grid on resize" Margin="0,0,0,10" />
|
||||
<Controls:NumberBox x:Name="RowsToScroll"
|
||||
Header="Rows to scroll"
|
||||
Value="30"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
Width="100" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,30 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Keybindings.h"
|
||||
#if __has_include("Keybindings.g.cpp")
|
||||
#include "Keybindings.g.cpp"
|
||||
#endif
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
Keybindings::Keybindings()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
int32_t Keybindings::MyProperty()
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Keybindings::MyProperty(int32_t /* value */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Keybindings::ClickHandler(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
//Button().Content(box_value(L"Clicked"));
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Keybindings.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
struct Keybindings : KeybindingsT<Keybindings>
|
||||
{
|
||||
Keybindings();
|
||||
|
||||
int32_t MyProperty();
|
||||
void MyProperty(int32_t value);
|
||||
|
||||
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
|
||||
{
|
||||
struct Keybindings : KeybindingsT<Keybindings, implementation::Keybindings>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Control
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Keybindings : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Keybindings();
|
||||
Int32 MyProperty;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Control.Keybindings"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Control"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text="Keybindings"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,8" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,93 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "MainPage.h"
|
||||
#include "MainPage.g.cpp"
|
||||
#include "Globals.h"
|
||||
#include "Profiles.h"
|
||||
#include "ColorSchemes.h"
|
||||
#include "Keybindings.h"
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
MainPage::MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
int32_t MainPage::MyProperty()
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void MainPage::MyProperty(int32_t /* value */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainPage::SettingsNav_Loaded(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
//// set the initial selectedItem
|
||||
for (uint32_t i = 0; i < SettingsNav().MenuItems().Size(); i++)
|
||||
{
|
||||
const auto item = SettingsNav().MenuItems().GetAt(i).as<Controls::NavigationViewItemBase>();
|
||||
const hstring globalsNav = L"Globals_Nav";
|
||||
const hstring itemTag = unbox_value<hstring>(item.Tag());
|
||||
|
||||
if (itemTag == globalsNav)
|
||||
{
|
||||
item.IsSelected(true);
|
||||
SettingsNav().Header() = item.Tag();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
contentFrame().Navigate(xaml_typename<Control::Globals>());
|
||||
}
|
||||
|
||||
void MainPage::SettingsNav_SelectionChanged(Controls::NavigationView sender, Controls::NavigationViewSelectionChangedEventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainPage::SettingsNav_ItemInvoked(Controls::NavigationView sender, Controls::NavigationViewItemInvokedEventArgs args)
|
||||
{
|
||||
Controls::TextBlock item = args.InvokedItem().as<Controls::TextBlock>();
|
||||
|
||||
if (item != NULL)
|
||||
{
|
||||
const hstring globalsPage = L"Globals_Page";
|
||||
const hstring profilesPage = L"Profiles_Page";
|
||||
const hstring colorSchemesPage = L"ColorSchemes_Page";
|
||||
const hstring keybindingsPage = L"Keybindings_Page";
|
||||
|
||||
if (unbox_value<hstring>(item.Tag()) == globalsPage)
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Control::Globals>());
|
||||
}
|
||||
else if (unbox_value<hstring>(item.Tag()) == profilesPage)
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Control::Profiles>());
|
||||
}
|
||||
else if (unbox_value<hstring>(item.Tag()) == colorSchemesPage)
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Control::ColorSchemes>());
|
||||
}
|
||||
else if (unbox_value<hstring>(item.Tag()) == keybindingsPage)
|
||||
{
|
||||
contentFrame().Navigate(xaml_typename<Control::Keybindings>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//void winrt::Microsoft::Terminal::Settings::Control::implementation::MainPage::SettingsNav_SelectionChanged(winrt::Windows::UI::Xaml::Controls::NavigationView const& sender, winrt::Windows::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs const& args)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "MainPage.g.h"
|
||||
#include "winrt/Microsoft.UI.Xaml.Controls.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
struct MainPage : MainPageT<MainPage>
|
||||
{
|
||||
MainPage();
|
||||
|
||||
int32_t MyProperty();
|
||||
void MyProperty(int32_t value);
|
||||
|
||||
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void SettingsNav_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void SettingsNav_SelectionChanged(Windows::UI::Xaml::Controls::NavigationView sender, Windows::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs args);
|
||||
void SettingsNav_ItemInvoked(Windows::UI::Xaml::Controls::NavigationView sender, Windows::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs args);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
|
||||
{
|
||||
struct MainPage : MainPageT<MainPage, implementation::MainPage>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Control
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
MainPage();
|
||||
Int32 MyProperty;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Control.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Control"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<NavigationView x:Name="SettingsNav"
|
||||
IsSettingsVisible="False"
|
||||
Loaded="SettingsNav_Loaded"
|
||||
SelectionChanged="SettingsNav_SelectionChanged"
|
||||
ItemInvoked="SettingsNav_ItemInvoked">
|
||||
<NavigationView.AutoSuggestBox>
|
||||
<AutoSuggestBox PlaceholderText="Search" QueryIcon="Find"/>
|
||||
</NavigationView.AutoSuggestBox>
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem Icon="Globe"
|
||||
Tag="Globals_Nav" >
|
||||
<TextBlock Tag="Globals_Page">Globals</TextBlock>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem Tag="Profiles_Nav">
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</NavigationViewItem.Icon>
|
||||
<TextBlock Tag="Profiles_Page">Profiles</TextBlock>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem Tag="ColorSchemes_Nav">
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""></FontIcon>
|
||||
</NavigationViewItem.Icon>
|
||||
<TextBlock Tag="ColorSchemes_Page">Color Schemes</TextBlock>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem Icon="Keyboard"
|
||||
Tag="Keybindings_Nav">
|
||||
<TextBlock Tag="Keybindings_Page">Keybindings</TextBlock>
|
||||
</NavigationViewItem>
|
||||
</NavigationView.MenuItems>
|
||||
<NavigationView.PaneFooter>
|
||||
<NavigationViewItem>
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</NavigationViewItem.Icon>
|
||||
<TextBlock>Open JSON file</TextBlock>
|
||||
</NavigationViewItem>
|
||||
</NavigationView.PaneFooter>
|
||||
<Frame x:Name="contentFrame"
|
||||
Margin="20"></Frame>
|
||||
</NavigationView>
|
||||
</Page>
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Profiles.h"
|
||||
#include "Profiles.g.cpp"
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
Profiles::Profiles()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Profiles::Profiles(winrt::hstring const& name) : m_name{ name }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
winrt::hstring Profiles::Name()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
void Profiles::Name(winrt::hstring const& value)
|
||||
{
|
||||
if (m_name != value)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int32_t Profiles::MyProperty()
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Profiles::MyProperty(int32_t /* value */)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
||||
void Profiles::ClickHandler(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Profiles.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
|
||||
{
|
||||
struct Profiles : ProfilesT<Profiles>
|
||||
{
|
||||
Profiles();
|
||||
Profiles(winrt::hstring const& name);
|
||||
|
||||
int32_t MyProperty();
|
||||
void MyProperty(int32_t value);
|
||||
winrt::hstring Name();
|
||||
void Name(winrt::hstring const& value);
|
||||
|
||||
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
|
||||
private:
|
||||
winrt::hstring m_name;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
|
||||
{
|
||||
struct Profiles : ProfilesT<Profiles, implementation::Profiles>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Control
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Profiles : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Profiles();
|
||||
Int32 MyProperty;
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Control.Profiles"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Control"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text="Profiles"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,8" />
|
||||
|
||||
<GridView x:Name="ProfilesGridView"
|
||||
Margin="0,0,0,8"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True"
|
||||
RelativePanel.Below="TitleTextBox">
|
||||
<GridView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
|
||||
MaximumRowsOrColumns="2"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</GridView.ItemsPanel>
|
||||
<Image Source="Assets/AllTerminalProfiles (2).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalProfiles (3).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalProfiles (4).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalProfiles (5).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalProfiles (6).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
<Image Source="Assets/AllTerminalProfiles (7).png"
|
||||
Stretch="Uniform"
|
||||
Width="300"/>
|
||||
</GridView>
|
||||
</RelativePanel>
|
||||
|
||||
<!--
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Profiles"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,10" />
|
||||
|
||||
<GridView x:Name="StyledGrid"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,100,0" >
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
<GridView.ItemContainerStyle>
|
||||
<Style TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="5, 5, 5, 5"/>
|
||||
</Style>
|
||||
</GridView.ItemContainerStyle>
|
||||
|
||||
An extra property also needs to be added to the GridView's ItemsWrapGrid.
|
||||
The following sets the maximum # of items to show before wrapping.
|
||||
<GridView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
|
||||
MaximumRowsOrColumns="2"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</GridView.ItemsPanel>
|
||||
|
||||
<x:String>Defaults</x:String>
|
||||
<x:String>Command Prompt</x:String>
|
||||
<x:String>Windows PowerShell</x:String>
|
||||
<x:String>Ubuntu</x:String>
|
||||
<x:String>PowerShell Core</x:String>
|
||||
<x:String>Add New</x:String>
|
||||
</GridView>
|
||||
</Grid> -->
|
||||
<!--<DataTemplate x:Name="ImageOverlayTemplate">
|
||||
<Grid Width="100">
|
||||
<Image Stretch="UniformToFill"/>
|
||||
<StackPanel Orientation="Vertical" Height="40" VerticalAlignment="Bottom" Padding="5,1,5,1"
|
||||
Background="LightGray" Opacity=".75">
|
||||
<TextBlock Text="Defaults"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="More defaults" Style="{ThemeResource CaptionTextBlockStyle}"
|
||||
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
|
||||
<TextBlock Text=" Likes" Style="{ThemeResource CaptionTextBlockStyle}"
|
||||
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>-->
|
||||
|
||||
|
||||
|
||||
</Page>
|
||||
@@ -1,161 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}</ProjectGuid>
|
||||
<ProjectName>TerminalSettingsControl</ProjectName>
|
||||
<RootNamespace>Microsoft.Terminal.Settings.Control</RootNamespace>
|
||||
<!-- cppwinrt.build.pre.props depends on these settings: -->
|
||||
<!-- build a dll, not exe (Application) -->
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<!-- sets a bunch of Windows Universal properties -->
|
||||
<OpenConsoleUniversalApp>true</OpenConsoleUniversalApp>
|
||||
<!-- C++/WinRT sets the depth to 1 if there is a XAML file in the project
|
||||
Unfortunately for us, we need it to be 3. When the namespace merging
|
||||
depth is 1, Microsoft.Terminal.Settings.Control becomes "Microsoft",
|
||||
and our WinMD file becomes "Microsoft". Because WinRT is very
|
||||
namespace-driven, this winmd is considered to contain the entire
|
||||
Microsoft namespace. This is, obviously, not great. None of our other
|
||||
projects compile properly when they depend on this "Microsoft.winmd."
|
||||
-->
|
||||
<CppWinRTNamespaceMergeDepth>4</CppWinRTNamespaceMergeDepth>
|
||||
<!--
|
||||
DON'T REDIRECT OUR OUTPUT.
|
||||
Setting this will tell cppwinrt.build.post.props to copy our output from
|
||||
the default OutDir up one level, so the wapproj will be able to find it.
|
||||
-->
|
||||
<NoOutputRedirection>true</NoOutputRedirection>
|
||||
<XamlComponentResourceLocation>nested</XamlComponentResourceLocation>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
<!-- Without this, the TerminalSettingsControl will forward the Microsoft.UI.XAML dependency upward and cause MDMerge to see the same type twicehttps
|
||||
https://github.com/microsoft/microsoft-ui-xaml/issues/1573 -->
|
||||
<ItemDefinitionGroup>
|
||||
<Reference>
|
||||
<Private Condition="'$(ConfigurationType)' != 'Application'">false</Private>
|
||||
</Reference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="ColorSchemes.h">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Globals.h">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Keybindings.h">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MainPage.h">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Profiles.h">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="init.cpp" />
|
||||
<ClCompile Include="ColorSchemes.cpp">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Globals.cpp">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Keybindings.cpp">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MainPage.cpp">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Profiles.cpp">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="ColorSchemes.idl">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="Globals.idl">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="Keybindings.idl">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="MainPage.idl">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="Profiles.idl">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="TerminalSettingsControl.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Resources\*\Resources.resw" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Project References ======================== -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\types\lib\types.vcxproj" />
|
||||
<ProjectReference Include="..\..\buffer\out\lib\bufferout.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\renderer\base\lib\base.vcxproj" />
|
||||
<ProjectReference Include="..\..\renderer\dx\lib\dx.vcxproj" />
|
||||
<ProjectReference Include="..\..\renderer\uia\lib\uia.vcxproj" />
|
||||
<ProjectReference Include="..\..\terminal\parser\lib\parser.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\terminal\input\lib\terminalinput.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj">
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalCore\lib\TerminalCore-lib.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\WinRTUtils\WinRTUtils.vcxproj">
|
||||
<Project>{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="ColorSchemes.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Globals.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Keybindings.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Profiles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<AdditionalDependencies>dwrite.lib;dxgi.lib;d2d1.lib;d3d11.lib;shcore.lib;winmm.lib;pathcch.lib;propsys.lib;uiautomationcore.lib;Shlwapi.lib;ntdll.lib;user32.lib;kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(OpenConsoleDir)src\cascadia\inc;$(OpenConsoleDir)src\types\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Resources">
|
||||
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
<ClCompile Include="ColorSchemes.cpp" />
|
||||
<ClCompile Include="Globals.cpp" />
|
||||
<ClCompile Include="Keybindings.cpp" />
|
||||
<ClCompile Include="MainPage.cpp" />
|
||||
<ClCompile Include="Profiles.cpp" />
|
||||
<ClCompile Include="init.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="ColorSchemes.h" />
|
||||
<ClInclude Include="Globals.h" />
|
||||
<ClInclude Include="Keybindings.h" />
|
||||
<ClInclude Include="MainPage.h" />
|
||||
<ClInclude Include="Profiles.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="ColorSchemes.idl" />
|
||||
<Midl Include="Globals.idl" />
|
||||
<Midl Include="Keybindings.idl" />
|
||||
<Midl Include="MainPage.idl" />
|
||||
<Midl Include="Profiles.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="TerminalSettingsControl.def" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="ColorSchemes.xaml" />
|
||||
<Page Include="Globals.xaml" />
|
||||
<Page Include="Keybindings.xaml" />
|
||||
<Page Include="MainPage.xaml" />
|
||||
<Page Include="Profiles.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Resources\*\Resources.resw">
|
||||
<Filter>Resources</Filter>
|
||||
</PRIResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
|
||||
// Note: Generate GUID using TlgGuid.exe tool
|
||||
TRACELOGGING_DEFINE_PROVIDER(
|
||||
g_hTerminalSettingsControlProvider,
|
||||
"Microsoft.Windows.Terminal.Settings.Control",
|
||||
// {58272983-4ad8-5de8-adbc-2db4810c3b21}
|
||||
(0x58272983,0x4ad8,0x5de8,0xad,0xbc,0x2d,0xb4,0x81,0x0c,0x3b,0x21),
|
||||
TraceLoggingOptionMicrosoftTelemetry());
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD reason, LPVOID /*reserved*/)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hInstDll);
|
||||
TraceLoggingRegister(g_hTerminalSettingsControlProvider);
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
if (g_hTerminalSettingsControlProvider)
|
||||
{
|
||||
TraceLoggingUnregister(g_hTerminalSettingsControlProvider);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.Settings.Control/Resources");
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.UI.Xaml" version="2.3.191217003-prerelease" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -1,4 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
@@ -1,57 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// pch.h
|
||||
// Header for platform projection include files
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
||||
#define BLOCK_TIL
|
||||
#include <LibraryIncludes.h>
|
||||
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
|
||||
// SDK definition of this function, so the only fix is to undef it.
|
||||
// from WinBase.h
|
||||
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
|
||||
#ifdef GetCurrentTime
|
||||
#undef GetCurrentTime
|
||||
#endif
|
||||
|
||||
#include <wil/cppwinrt.h>
|
||||
|
||||
#include <unknwn.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
#include <winrt/Windows.system.h>
|
||||
#include <winrt/Windows.Graphics.Display.h>
|
||||
#include <winrt/windows.ui.core.h>
|
||||
#include <winrt/Windows.ui.input.h>
|
||||
#include <winrt/Windows.UI.ViewManagement.h>
|
||||
#include <winrt/Windows.UI.Xaml.h>
|
||||
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
|
||||
#include <winrt/Windows.UI.Text.Core.h>
|
||||
#include <winrt/Windows.UI.Xaml.Controls.h>
|
||||
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
|
||||
#include <winrt/Windows.UI.Xaml.Data.h>
|
||||
#include <winrt/Windows.UI.Xaml.Media.h>
|
||||
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
|
||||
#include <winrt/Windows.UI.Xaml.Input.h>
|
||||
#include <winrt/Windows.UI.Xaml.Interop.h>
|
||||
#include <winrt/Windows.ui.xaml.markup.h>
|
||||
#include <winrt/Windows.ApplicationModel.DataTransfer.h>
|
||||
#include <winrt/Windows.Storage.h>
|
||||
|
||||
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
||||
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
|
||||
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
|
||||
|
||||
#include <windows.ui.xaml.media.dxinterop.h>
|
||||
|
||||
#include <TraceLoggingProvider.h>
|
||||
TRACELOGGING_DECLARE_PROVIDER(g_hTerminalControlProvider);
|
||||
#include <telemetry/ProjectTelemetry.h>
|
||||
|
||||
#include "til.h"
|
||||
@@ -1,3 +0,0 @@
|
||||
EXPORTS
|
||||
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
|
||||
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
|
||||
@@ -3,6 +3,22 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Method Description:
|
||||
// - Converts a COLORREF to Color
|
||||
// Arguments:
|
||||
// - colorref: COLORREF to convert to Color
|
||||
// Return Value:
|
||||
// - Color containing the RGB values from colorref
|
||||
inline winrt::Windows::UI::Color ColorRefToColor(const COLORREF& colorref)
|
||||
{
|
||||
winrt::Windows::UI::Color color;
|
||||
color.A = 255;
|
||||
color.R = GetRValue(colorref);
|
||||
color.G = GetGValue(colorref);
|
||||
color.B = GetBValue(colorref);
|
||||
return color;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Scales a Rect based on a scale factor
|
||||
// Arguments:
|
||||
|
||||
@@ -20,7 +20,7 @@ static constexpr int AutohideTaskbarSize = 2;
|
||||
|
||||
NonClientIslandWindow::NonClientIslandWindow(const ElementTheme& requestedTheme) noexcept :
|
||||
IslandWindow{},
|
||||
_backgroundBrushColor{ 0, 0, 0 },
|
||||
_backgroundBrushColor{ RGB(0, 0, 0) },
|
||||
_theme{ requestedTheme },
|
||||
_isMaximized{ false }
|
||||
{
|
||||
@@ -205,11 +205,6 @@ void NonClientIslandWindow::Initialize()
|
||||
_rootGrid.Children().Append(_titlebar);
|
||||
|
||||
Controls::Grid::SetRow(_titlebar, 0);
|
||||
|
||||
// GH#3440 - When the titlebar is loaded (officially added to our UI tree),
|
||||
// then make sure to update it's visual state to reflect if we're in the
|
||||
// maximized state on launch.
|
||||
_titlebar.Loaded([this](auto&&, auto&&) { _OnMaximizeChange(); });
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -740,12 +735,13 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
|
||||
|
||||
const auto backgroundBrush = _titlebar.Background();
|
||||
const auto backgroundSolidBrush = backgroundBrush.as<Media::SolidColorBrush>();
|
||||
const til::color backgroundColor = backgroundSolidBrush.Color();
|
||||
const auto backgroundColor = backgroundSolidBrush.Color();
|
||||
const auto color = RGB(backgroundColor.R, backgroundColor.G, backgroundColor.B);
|
||||
|
||||
if (!_backgroundBrush || backgroundColor != _backgroundBrushColor)
|
||||
if (!_backgroundBrush || color != _backgroundBrushColor)
|
||||
{
|
||||
// Create brush for titlebar color.
|
||||
_backgroundBrush = wil::unique_hbrush(CreateSolidBrush(backgroundColor));
|
||||
_backgroundBrush = wil::unique_hbrush(CreateSolidBrush(color));
|
||||
}
|
||||
|
||||
// To hide the original title bar, we have to paint on top of it with
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
winrt::Windows::UI::Xaml::UIElement _clientContent{ nullptr };
|
||||
|
||||
wil::unique_hbrush _backgroundBrush;
|
||||
til::color _backgroundBrushColor;
|
||||
COLORREF _backgroundBrushColor;
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::Border _dragBar{ nullptr };
|
||||
wil::unique_hwnd _dragBarWindow;
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace TerminalAppUnitTests
|
||||
TEST_METHOD(ParseInvalidJson);
|
||||
TEST_METHOD(ParseSimpleColorScheme);
|
||||
TEST_METHOD(ProfileGeneratesGuid);
|
||||
TEST_METHOD(DiffProfile);
|
||||
TEST_METHOD(DiffProfileWithNull);
|
||||
|
||||
TEST_METHOD(TestWrongValueType);
|
||||
|
||||
@@ -170,6 +172,59 @@ namespace TerminalAppUnitTests
|
||||
VERIFY_ARE_EQUAL(profile4.GetGuid(), cmdGuid);
|
||||
}
|
||||
|
||||
void JsonTests::DiffProfile()
|
||||
{
|
||||
Profile profile0;
|
||||
Profile profile1;
|
||||
|
||||
Log::Comment(NoThrowString().Format(
|
||||
L"Both these profiles are the same, their diff should have _no_ values"));
|
||||
|
||||
auto diff = profile1.DiffToJson(profile0);
|
||||
|
||||
Log::Comment(NoThrowString().Format(L"diff:%hs", Json::writeString(_builder, diff).c_str()));
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, diff.getMemberNames().size());
|
||||
|
||||
profile1._name = L"profile1";
|
||||
diff = profile1.DiffToJson(profile0);
|
||||
Log::Comment(NoThrowString().Format(L"diff:%hs", Json::writeString(_builder, diff).c_str()));
|
||||
VERIFY_ARE_EQUAL(1u, diff.getMemberNames().size());
|
||||
}
|
||||
|
||||
void JsonTests::DiffProfileWithNull()
|
||||
{
|
||||
Profile profile0;
|
||||
Profile profile1;
|
||||
|
||||
profile0._icon = L"foo";
|
||||
|
||||
Log::Comment(NoThrowString().Format(
|
||||
L"Case 1: Base object has an optional that the derived does not - diff will have null for that value"));
|
||||
auto diff = profile1.DiffToJson(profile0);
|
||||
|
||||
Log::Comment(NoThrowString().Format(L"diff:%hs", Json::writeString(_builder, diff).c_str()));
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, diff.getMemberNames().size());
|
||||
VERIFY_IS_TRUE(diff.isMember("icon"));
|
||||
VERIFY_IS_TRUE(diff["icon"].isNull());
|
||||
|
||||
Log::Comment(NoThrowString().Format(
|
||||
L"Case 2: Add an optional to the derived object that's not present in the root."));
|
||||
|
||||
profile0._icon = std::nullopt;
|
||||
profile1._icon = L"bar";
|
||||
|
||||
diff = profile1.DiffToJson(profile0);
|
||||
|
||||
Log::Comment(NoThrowString().Format(L"diff:%hs", Json::writeString(_builder, diff).c_str()));
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, diff.getMemberNames().size());
|
||||
VERIFY_IS_TRUE(diff.isMember("icon"));
|
||||
VERIFY_IS_TRUE(diff["icon"].isString());
|
||||
VERIFY_IS_TRUE("bar" == diff["icon"].asString());
|
||||
}
|
||||
|
||||
void JsonTests::TestWrongValueType()
|
||||
{
|
||||
// This json blob has a whole bunch of settings with the wrong value
|
||||
|
||||
@@ -60,6 +60,9 @@ void ConsoleImeInfo::WriteCompMessage(const std::wstring_view text,
|
||||
const std::basic_string_view<BYTE> attributes,
|
||||
const std::basic_string_view<WORD> colorArray)
|
||||
{
|
||||
// Backup the cursor visibility state and turn it off for drawing.
|
||||
_SaveCursorVisibility();
|
||||
|
||||
ClearAllAreas();
|
||||
|
||||
// Save copies of the composition message in case we need to redraw it as things scroll/resize
|
||||
@@ -77,6 +80,8 @@ void ConsoleImeInfo::WriteCompMessage(const std::wstring_view text,
|
||||
// - text - The actual text of what the user would like to insert (UTF-16)
|
||||
void ConsoleImeInfo::WriteResultMessage(const std::wstring_view text)
|
||||
{
|
||||
_RestoreCursorVisibility();
|
||||
|
||||
ClearAllAreas();
|
||||
|
||||
_InsertConvertedString(text);
|
||||
@@ -466,7 +471,7 @@ void ConsoleImeInfo::_InsertConvertedString(const std::wstring_view text)
|
||||
// Routine Description:
|
||||
// - Backs up the global cursor visibility state if it is shown and disables
|
||||
// it while we work on the conversion areas.
|
||||
void ConsoleImeInfo::SaveCursorVisibility()
|
||||
void ConsoleImeInfo::_SaveCursorVisibility()
|
||||
{
|
||||
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
Cursor& cursor = gci.GetActiveOutputBuffer().GetTextBuffer().GetCursor();
|
||||
@@ -482,7 +487,7 @@ void ConsoleImeInfo::SaveCursorVisibility()
|
||||
|
||||
// Routine Description:
|
||||
// - Restores the global cursor visibility state if it was on when it was backed up.
|
||||
void ConsoleImeInfo::RestoreCursorVisibility()
|
||||
void ConsoleImeInfo::_RestoreCursorVisibility()
|
||||
{
|
||||
if (_isSavedCursorVisible)
|
||||
{
|
||||
|
||||
@@ -55,9 +55,6 @@ public:
|
||||
|
||||
void RedrawCompMessage();
|
||||
|
||||
void SaveCursorVisibility();
|
||||
void RestoreCursorVisibility();
|
||||
|
||||
private:
|
||||
[[nodiscard]] HRESULT _AddConversionArea();
|
||||
|
||||
@@ -83,6 +80,8 @@ private:
|
||||
const Microsoft::Console::Types::Viewport view,
|
||||
SCREEN_INFORMATION& screenInfo);
|
||||
|
||||
void _SaveCursorVisibility();
|
||||
void _RestoreCursorVisibility();
|
||||
bool _isSavedCursorVisible;
|
||||
|
||||
std::wstring _text;
|
||||
|
||||
@@ -104,9 +104,6 @@ void WriteConvRegionToScreen(const SCREEN_INFORMATION& ScreenInfo,
|
||||
gci.LockConsole();
|
||||
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
|
||||
|
||||
ConsoleImeInfo* const pIme = &gci.ConsoleIme;
|
||||
pIme->SaveCursorVisibility();
|
||||
|
||||
gci.pInputBuffer->fInComposition = true;
|
||||
return S_OK;
|
||||
}
|
||||
@@ -117,9 +114,6 @@ void WriteConvRegionToScreen(const SCREEN_INFORMATION& ScreenInfo,
|
||||
gci.LockConsole();
|
||||
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
|
||||
|
||||
ConsoleImeInfo* const pIme = &gci.ConsoleIme;
|
||||
pIme->RestoreCursorVisibility();
|
||||
|
||||
gci.pInputBuffer->fInComposition = false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ constexpr COLORREF DEFAULT_FOREGROUND_WITH_ALPHA = OPACITY_OPAQUE | DEFAULT_FORE
|
||||
constexpr COLORREF DEFAULT_BACKGROUND = COLOR_BLACK;
|
||||
constexpr COLORREF DEFAULT_BACKGROUND_WITH_ALPHA = OPACITY_OPAQUE | DEFAULT_BACKGROUND;
|
||||
|
||||
constexpr COLORREF POWERSHELL_BLUE = RGB(1, 36, 86);
|
||||
|
||||
constexpr short DEFAULT_HISTORY_SIZE = 9001;
|
||||
|
||||
#pragma warning(push)
|
||||
@@ -30,7 +32,6 @@ constexpr short DEFAULT_HISTORY_SIZE = 9001;
|
||||
// TODO GH 2674, don't disable this warning, move to std::wstring_view or something like that.
|
||||
const std::wstring DEFAULT_FONT_FACE{ L"Cascadia Mono" };
|
||||
constexpr int DEFAULT_FONT_SIZE = 12;
|
||||
constexpr uint16_t DEFAULT_FONT_WEIGHT = 400; // normal
|
||||
|
||||
constexpr int DEFAULT_ROWS = 30;
|
||||
constexpr int DEFAULT_COLS = 120;
|
||||
|
||||
@@ -101,16 +101,6 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
||||
{
|
||||
}
|
||||
|
||||
constexpr color with_alpha(uint8_t alpha) const
|
||||
{
|
||||
return color{
|
||||
r,
|
||||
g,
|
||||
b,
|
||||
alpha
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef D3DCOLORVALUE_DEFINED
|
||||
constexpr operator D3DCOLORVALUE() const
|
||||
{
|
||||
@@ -118,61 +108,10 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WINRT_Windows_UI_H
|
||||
constexpr color(const winrt::Windows::UI::Color& winUIColor) :
|
||||
color(winUIColor.R, winUIColor.G, winUIColor.B, winUIColor.A)
|
||||
{
|
||||
}
|
||||
|
||||
operator winrt::Windows::UI::Color() const
|
||||
{
|
||||
winrt::Windows::UI::Color ret;
|
||||
ret.R = r;
|
||||
ret.G = g;
|
||||
ret.B = b;
|
||||
ret.A = a;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
constexpr bool operator==(const til::color& other) const
|
||||
{
|
||||
return r == other.r && g == other.g && b == other.b && a == other.a;
|
||||
}
|
||||
|
||||
constexpr bool operator!=(const til::color& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
std::wstring to_string() const
|
||||
{
|
||||
std::wstringstream wss;
|
||||
wss << L"Color #" << std::uppercase << std::setfill(L'0') << std::hex;
|
||||
// Force the compiler to promote from byte to int. Without it, the
|
||||
// stringstream will try to write the components as chars
|
||||
wss << std::setw(2) << static_cast<int>(a);
|
||||
wss << std::setw(2) << static_cast<int>(r);
|
||||
wss << std::setw(2) << static_cast<int>(g);
|
||||
wss << std::setw(2) << static_cast<int>(b);
|
||||
|
||||
return wss.str();
|
||||
}
|
||||
};
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
||||
#ifdef __WEX_COMMON_H__
|
||||
namespace WEX::TestExecution
|
||||
{
|
||||
template<>
|
||||
class VerifyOutputTraits<::til::color>
|
||||
{
|
||||
public:
|
||||
static WEX::Common::NoThrowString ToString(const ::til::color& color)
|
||||
{
|
||||
return WEX::Common::NoThrowString(color.to_string().c_str());
|
||||
}
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "precomp.h"
|
||||
#include "TerminalPropsheetPage.h"
|
||||
#include "TerminalPage.h"
|
||||
#include "OptionsPage.h" // For InitializeCursorSize
|
||||
#include "ColorControl.h"
|
||||
#include <functional>
|
||||
@@ -26,7 +26,7 @@ Revision History:
|
||||
#include "OptionsPage.h"
|
||||
#include "LayoutPage.h"
|
||||
#include "ColorsPage.h"
|
||||
#include "TerminalPropsheetPage.h"
|
||||
#include "TerminalPage.h"
|
||||
#include "ColorControl.h"
|
||||
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>propsheet</RootNamespace>
|
||||
<ProjectName>Propsheet.DLL</ProjectName>
|
||||
<TargetName>console</TargetName>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\common.build.pre.props" />
|
||||
<ItemGroup>
|
||||
@@ -23,7 +23,7 @@
|
||||
<ClCompile Include="LayoutPage.cpp" />
|
||||
<ClCompile Include="ColorsPage.cpp" />
|
||||
<ClCompile Include="ColorControl.cpp" />
|
||||
<ClCompile Include="TerminalPropsheetPage.cpp" />
|
||||
<ClCompile Include="TerminalPage.cpp" />
|
||||
<ClCompile Include="registry.cpp" />
|
||||
<ClCompile Include="util.cpp" />
|
||||
<ClCompile Include="precomp.cpp">
|
||||
@@ -41,7 +41,7 @@
|
||||
<ClInclude Include="LayoutPage.h" />
|
||||
<ClInclude Include="ColorsPage.h" />
|
||||
<ClInclude Include="ColorControl.h" />
|
||||
<ClInclude Include="TerminalPropsheetPage.h" />
|
||||
<ClInclude Include="TerminalPage.h" />
|
||||
<ClInclude Include="menu.h" />
|
||||
<ClInclude Include="precomp.h" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -50,24 +50,24 @@ PRECOMPILED_PCH = precomp.pch
|
||||
PRECOMPILED_OBJ = precomp.obj
|
||||
|
||||
SOURCES = \
|
||||
dll.cpp \
|
||||
util.cpp \
|
||||
console.cpp \
|
||||
globals.cpp \
|
||||
fontdlg.cpp \
|
||||
OptionsPage.cpp \
|
||||
ColorsPage.cpp \
|
||||
ColorControl.cpp \
|
||||
ColorsPage.cpp \
|
||||
LayoutPage.cpp \
|
||||
TerminalPropsheetPage.cpp \
|
||||
init.cpp \
|
||||
misc.cpp \
|
||||
preview.cpp \
|
||||
registry.cpp \
|
||||
dbcs.cpp \
|
||||
strid.mc \
|
||||
PropSheetHandler.cpp \
|
||||
dll.cpp \
|
||||
util.cpp \
|
||||
console.cpp \
|
||||
globals.cpp \
|
||||
fontdlg.cpp \
|
||||
OptionsPage.cpp \
|
||||
ColorsPage.cpp \
|
||||
ColorControl.cpp \
|
||||
ColorsPage.cpp \
|
||||
LayoutPage.cpp \
|
||||
TerminalPage.cpp \
|
||||
init.cpp \
|
||||
misc.cpp \
|
||||
preview.cpp \
|
||||
registry.cpp \
|
||||
dbcs.cpp \
|
||||
strid.mc \
|
||||
PropSheetHandler.cpp \
|
||||
console.rc
|
||||
|
||||
INCLUDES = \
|
||||
|
||||
@@ -2003,7 +2003,7 @@ CATCH_RETURN();
|
||||
try
|
||||
{
|
||||
std::wstring fontName(desired.GetFaceName());
|
||||
DWRITE_FONT_WEIGHT weight = static_cast<DWRITE_FONT_WEIGHT>(desired.GetWeight());
|
||||
DWRITE_FONT_WEIGHT weight = DWRITE_FONT_WEIGHT_NORMAL;
|
||||
DWRITE_FONT_STYLE style = DWRITE_FONT_STYLE_NORMAL;
|
||||
DWRITE_FONT_STRETCH stretch = DWRITE_FONT_STRETCH_NORMAL;
|
||||
std::wstring localeName = _GetLocaleName();
|
||||
|
||||
@@ -4,6 +4,19 @@
|
||||
#include "precomp.h"
|
||||
#include "WexTestClass.h"
|
||||
|
||||
namespace WEX::TestExecution
|
||||
{
|
||||
template<>
|
||||
class VerifyOutputTraits<til::color>
|
||||
{
|
||||
public:
|
||||
static WEX::Common::NoThrowString ToString(const til::color& c)
|
||||
{
|
||||
return WEX::Common::NoThrowString().Format(L"(RGBA: %2.02x%2.02x%2.02x%2.02x)", c.r, c.g, c.b, c.a);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
using namespace WEX::Common;
|
||||
using namespace WEX::Logging;
|
||||
using namespace WEX::TestExecution;
|
||||
@@ -88,24 +101,4 @@ class ColorTests
|
||||
|
||||
VERIFY_ARE_EQUAL(t2, static_cast<til::color>(q2));
|
||||
}
|
||||
|
||||
TEST_METHOD(WithAlpha)
|
||||
{
|
||||
const COLORREF c = 0x00FEEDFAu; // remember, this one is in 0BGR
|
||||
const til::color fromColorRef{ c };
|
||||
|
||||
VERIFY_ARE_EQUAL(0xfa, fromColorRef.r);
|
||||
VERIFY_ARE_EQUAL(0xed, fromColorRef.g);
|
||||
VERIFY_ARE_EQUAL(0xfe, fromColorRef.b);
|
||||
VERIFY_ARE_EQUAL(0xff, fromColorRef.a); // COLORREF do not have an alpha channel
|
||||
|
||||
const auto colorWithAlpha{ fromColorRef.with_alpha(0x7f) };
|
||||
|
||||
VERIFY_ARE_NOT_EQUAL(colorWithAlpha, fromColorRef);
|
||||
|
||||
VERIFY_ARE_EQUAL(0xfa, colorWithAlpha.r);
|
||||
VERIFY_ARE_EQUAL(0xed, colorWithAlpha.g);
|
||||
VERIFY_ARE_EQUAL(0xfe, colorWithAlpha.b);
|
||||
VERIFY_ARE_EQUAL(0x7f, colorWithAlpha.a);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#undef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <array>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace
|
||||
return range.upperBound < searchTerm;
|
||||
}
|
||||
|
||||
static constexpr std::array<UnicodeRange, 294> s_wideAndAmbiguousTable{
|
||||
static constexpr std::array<UnicodeRange, 342> s_wideAndAmbiguousTable{
|
||||
// generated from http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
|
||||
// anything not present here is presumed to be Narrow.
|
||||
//
|
||||
@@ -28,21 +28,6 @@ namespace
|
||||
// force a font lookup, but since we default all Ambiguous width to Narrow, those emojis always
|
||||
// came out looking squished/tiny. They've been moved into this table and marked as Wide.
|
||||
//
|
||||
// === UCD Definitions ===
|
||||
// EA - EastAsianWidth
|
||||
// Emoji - Emoji
|
||||
// EPres - Emoji Presentation
|
||||
// =======================
|
||||
//
|
||||
// This table has been partially regenerated from the Unicode Character Database as of 13.0, with
|
||||
// the following rules:
|
||||
// Codepoints whose EA is "W", "F" are Wide
|
||||
// Codepoints whose EA is "A" are Ambiguous
|
||||
// Codepoints where Emoji=Y and EPres=Y are Emoji, therefore Wide
|
||||
// -
|
||||
// Codepoints where Emoji=Y but EPres=*N* are only Emoji when followed
|
||||
// by U+FE0F variation selector 15.
|
||||
//
|
||||
// There are a couple of codepoints that Microsoft specifically gave an emoji representation
|
||||
// even if it's not specified as an emoji in the standard. I'll list the ones I'm aware of in this comment in case
|
||||
// we decide to add them in the future:
|
||||
@@ -52,6 +37,12 @@ namespace
|
||||
// 0x2664,
|
||||
// 0x2666 0x2710,
|
||||
// 0x270E 0x2765 0x1f000 - 0x1f02b except 0x1f004 0x1f594
|
||||
//
|
||||
// GH #5822 - Removed glyphs that appear inside of CP437 (https://en.wikipedia.org/wiki/Code_page_437)
|
||||
// and WGL4 (https://en.wikipedia.org/wiki/Windows_Glyph_List_4) since they've been narrow since the
|
||||
// beginning of time and changing it to wide would only cause destruction.
|
||||
//
|
||||
// *** Codepoint ranges marked with "OVR" have their given width from EastAsianWidth.txt overridden.
|
||||
UnicodeRange{ 0xa1, 0xa1, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0xa4, 0xa4, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0xa7, 0xa8, CodepointWidth::Ambiguous },
|
||||
@@ -137,6 +128,7 @@ namespace
|
||||
UnicodeRange{ 0x2121, 0x2122, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2126, 0x2126, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x212b, 0x212b, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2139, 0x2139, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2153, 0x2154, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x215b, 0x215e, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2160, 0x216b, CodepointWidth::Ambiguous },
|
||||
@@ -176,12 +168,15 @@ namespace
|
||||
UnicodeRange{ 0x22a5, 0x22a5, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x22bf, 0x22bf, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2312, 0x2312, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x231a, 0x231b, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2329, 0x232a, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x23e9, 0x23ec, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x23f0, 0x23f0, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x23f3, 0x23f3, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2460, 0x24e9, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x231a, 0x231b, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2328, 0x232a, CodepointWidth::Wide }, // OVR 328
|
||||
UnicodeRange{ 0x23cf, 0x23cf, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x23e9, 0x23ef, CodepointWidth::Wide }, // OVR 3ed-3ef
|
||||
UnicodeRange{ 0x23f0, 0x23f3, CodepointWidth::Wide }, // OVR 3f1-3f2
|
||||
UnicodeRange{ 0x23f8, 0x23fa, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2460, 0x24c1, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x24c2, 0x24c2, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x24c3, 0x24e9, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x24eb, 0x254b, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2550, 0x2573, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2580, 0x258f, CodepointWidth::Ambiguous },
|
||||
@@ -197,61 +192,87 @@ namespace
|
||||
UnicodeRange{ 0x25ce, 0x25d1, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x25e2, 0x25e5, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x25ef, 0x25ef, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x25fd, 0x25fe, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x25fb, 0x25fe, CodepointWidth::Wide }, // OVR 5fb-5fc
|
||||
UnicodeRange{ 0x2600, 0x2604, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2605, 0x2606, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2609, 0x2609, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x260e, 0x260e, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x260e, 0x260f, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2614, 0x2615, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x261c, 0x261c, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x261e, 0x261e, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2640, 0x2640, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2642, 0x2642, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2648, 0x2653, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2660, 0x2661, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2663, 0x2665, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2667, 0x266a, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2611, 0x2611, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2614, 0x2615, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2618, 0x2618, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x261d, 0x261d, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2620, 0x2620, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2622, 0x2623, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2626, 0x2626, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x262a, 0x262a, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x262e, 0x262f, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2638, 0x2639, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2648, 0x2653, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x265f, 0x265f, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2668, 0x2668, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2669, 0x266a, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x266c, 0x266d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x266f, 0x266f, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x267f, 0x267f, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2693, 0x2693, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x267b, 0x267b, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x267e, 0x267f, CodepointWidth::Wide }, // OVR 67e
|
||||
UnicodeRange{ 0x2692, 0x2697, CodepointWidth::Wide }, // OVR 692, 694-697
|
||||
UnicodeRange{ 0x2699, 0x2699, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x269b, 0x269c, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x269e, 0x269f, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26a1, 0x26a1, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26aa, 0x26ab, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26bd, 0x26be, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26a0, 0x26a1, CodepointWidth::Wide }, // OVR 6a0
|
||||
UnicodeRange{ 0x26a7, 0x26a7, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x26aa, 0x26ab, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x26b0, 0x26b1, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x26bd, 0x26be, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x26bf, 0x26bf, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26c4, 0x26c5, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26c6, 0x26cd, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26ce, 0x26ce, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26cf, 0x26d3, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26d4, 0x26d4, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26c4, 0x26c5, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x26c6, 0x26c7, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26c8, 0x26c8, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x26c9, 0x26cd, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26ce, 0x26cf, CodepointWidth::Wide }, // OVR 6CF
|
||||
UnicodeRange{ 0x26d0, 0x26d0, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26d1, 0x26d1, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x26d2, 0x26d2, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26d3, 0x26d4, CodepointWidth::Wide }, // OVR 6d3
|
||||
UnicodeRange{ 0x26d5, 0x26e1, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26e3, 0x26e3, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26e8, 0x26e9, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26ea, 0x26ea, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26eb, 0x26f1, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26f2, 0x26f3, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26f4, 0x26f4, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26f5, 0x26f5, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26f6, 0x26f9, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26fa, 0x26fa, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26e8, 0x26e8, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26e9, 0x26ea, CodepointWidth::Wide }, // OVR 6e9
|
||||
UnicodeRange{ 0x26eb, 0x26ef, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26f0, 0x26f5, CodepointWidth::Wide }, // OVR 6f0-6f1, 6f4
|
||||
UnicodeRange{ 0x26f6, 0x26f6, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26f7, 0x26fa, CodepointWidth::Wide }, // OVR 6f8-6f9
|
||||
UnicodeRange{ 0x26fb, 0x26fc, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x26fd, 0x26fd, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x26fd, 0x26fd, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x26fe, 0x26ff, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2705, 0x2705, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x270a, 0x270b, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2728, 0x2728, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2702, 0x2702, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2705, 0x2705, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2708, 0x270d, CodepointWidth::Wide }, // OVR 708-709, 70c-70d
|
||||
UnicodeRange{ 0x270f, 0x270f, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2712, 0x2712, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2714, 0x2714, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2716, 0x2716, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x271d, 0x271d, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2721, 0x2721, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2728, 0x2728, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2733, 0x2734, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x273d, 0x273d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x274c, 0x274c, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x274e, 0x274e, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2753, 0x2755, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2757, 0x2757, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2744, 0x2744, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2747, 0x2747, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x274c, 0x274c, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x274e, 0x274e, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2753, 0x2755, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2757, 0x2757, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2763, 0x2764, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x2776, 0x277f, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2795, 0x2797, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x27b0, 0x27b0, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x27bf, 0x27bf, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2b1b, 0x2b1c, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2b50, 0x2b50, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2b55, 0x2b55, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x2795, 0x2797, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x27a1, 0x27a1, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x27b0, 0x27b0, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x27bf, 0x27bf, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2b1b, 0x2b1c, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2b50, 0x2b50, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2b55, 0x2b55, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2b56, 0x2b59, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x2e80, 0x2e99, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x2e9b, 0x2ef3, CodepointWidth::Wide },
|
||||
@@ -288,59 +309,72 @@ namespace
|
||||
UnicodeRange{ 0x18800, 0x18af2, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1b000, 0x1b11e, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1b170, 0x1b2fb, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f004, 0x1f004, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f0cf, 0x1f0cf, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f004, 0x1f004, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f0cf, 0x1f0cf, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f100, 0x1f10a, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f110, 0x1f12d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f130, 0x1f169, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f170, 0x1f18d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f18e, 0x1f18e, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f170, 0x1f171, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f172, 0x1f17d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f17e, 0x1f17f, CodepointWidth::Wide }, // OVR 17f
|
||||
UnicodeRange{ 0x1f180, 0x1f18d, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f18e, 0x1f18e, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f18f, 0x1f190, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f191, 0x1f19a, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f191, 0x1f19a, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f19b, 0x1f1ac, CodepointWidth::Ambiguous },
|
||||
UnicodeRange{ 0x1f1e6, 0x1f1ff, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f1e6, 0x1f1ff, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f200, 0x1f202, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f210, 0x1f23b, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f240, 0x1f248, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f250, 0x1f251, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f250, 0x1f251, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f260, 0x1f265, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f300, 0x1f320, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f32d, 0x1f335, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f337, 0x1f37c, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f37e, 0x1f393, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f3a0, 0x1f3ca, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f3cf, 0x1f3d3, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f3e0, 0x1f3f0, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f3f4, 0x1f3f4, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f3f8, 0x1f43e, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f440, 0x1f440, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f442, 0x1f4fc, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f4ff, 0x1f53d, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f54b, 0x1f54e, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f550, 0x1f567, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f57a, 0x1f57a, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f595, 0x1f596, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f5a4, 0x1f5a4, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f5fb, 0x1f64f, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f680, 0x1f6c5, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f6cc, 0x1f6cc, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f6d0, 0x1f6d2, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f6d5, 0x1f6d7, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f6eb, 0x1f6ec, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f6f4, 0x1f6fc, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f7e0, 0x1f7eb, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f90c, 0x1f93a, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f93c, 0x1f945, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f947, 0x1f978, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f97a, 0x1f9cb, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f9cd, 0x1f9ff, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fa70, 0x1fa74, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fa78, 0x1fa7a, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fa80, 0x1fa86, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fa90, 0x1faa8, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fab0, 0x1fab6, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fac0, 0x1fac2, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1fad0, 0x1fad6, CodepointWidth::Wide }, // Emoji=Y EPres=Y
|
||||
UnicodeRange{ 0x1f300, 0x1f321, CodepointWidth::Wide }, // OVR 321
|
||||
UnicodeRange{ 0x1f324, 0x1f393, CodepointWidth::Wide }, // OVR 324-32c, 336, 37d
|
||||
UnicodeRange{ 0x1f396, 0x1f397, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f399, 0x1f39b, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f39e, 0x1f39f, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f3a0, 0x1f3f0, CodepointWidth::Wide }, // OVR 3cb-3ce, 3d4-3df
|
||||
UnicodeRange{ 0x1f3f3, 0x1f3f5, CodepointWidth::Wide }, // OVR 3f3, 3f5
|
||||
UnicodeRange{ 0x1f3f7, 0x1f4fd, CodepointWidth::Wide }, // OVR 3f7, 43f, 4fd
|
||||
UnicodeRange{ 0x1f4ff, 0x1f53d, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f549, 0x1f54e, CodepointWidth::Wide }, // OVR 549-54a
|
||||
UnicodeRange{ 0x1f550, 0x1f567, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f56f, 0x1f570, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f573, 0x1f57a, CodepointWidth::Wide }, // OVR 573-579
|
||||
UnicodeRange{ 0x1f587, 0x1f587, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f58a, 0x1f58d, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f590, 0x1f590, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f595, 0x1f596, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f5a4, 0x1f5a5, CodepointWidth::Wide }, // OVR 5a5
|
||||
UnicodeRange{ 0x1f5a8, 0x1f5a8, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5b1, 0x1f5b2, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5bc, 0x1f5bc, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5c2, 0x1f5c4, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5d1, 0x1f5d3, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5dc, 0x1f5de, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5e1, 0x1f5e1, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5e3, 0x1f5e3, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5e8, 0x1f5e8, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5ef, 0x1f5ef, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5f3, 0x1f5f3, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f5fa, 0x1f64f, CodepointWidth::Wide }, // OVR 5fa
|
||||
UnicodeRange{ 0x1f680, 0x1f6c5, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f6cb, 0x1f6d2, CodepointWidth::Wide }, // OVR 6cb, 6cd-6cf
|
||||
UnicodeRange{ 0x1f6d5, 0x1f6d7, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f6e0, 0x1f6e5, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f6e9, 0x1f6e9, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f6eb, 0x1f6ec, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f6f0, 0x1f6f0, CodepointWidth::Wide }, // OVR
|
||||
UnicodeRange{ 0x1f6f3, 0x1f6fc, CodepointWidth::Wide }, // OVR 6f3
|
||||
UnicodeRange{ 0x1f7e0, 0x1f7eb, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1f90c, 0x1f9ff, CodepointWidth::Wide }, // OVR 93b, 946
|
||||
UnicodeRange{ 0x1fa70, 0x1fa74, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fa78, 0x1fa7a, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fa80, 0x1fa86, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fa90, 0x1faa8, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fab0, 0x1fab6, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fac0, 0x1fac2, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x1fad0, 0x1fad6, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x20000, 0x2fffd, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0x30000, 0x3fffd, CodepointWidth::Wide },
|
||||
UnicodeRange{ 0xe0100, 0xe01ef, CodepointWidth::Ambiguous },
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace Microsoft::Console::Utils
|
||||
GUID GuidFromString(const std::wstring wstr);
|
||||
GUID CreateGuid();
|
||||
|
||||
std::string ColorToHexString(const til::color color);
|
||||
til::color ColorFromHexString(const std::string_view wstr);
|
||||
std::string ColorToHexString(const COLORREF color);
|
||||
COLORREF ColorFromHexString(const std::string wstr);
|
||||
|
||||
void InitializeCampbellColorTable(const gsl::span<COLORREF> table);
|
||||
void InitializeCampbellColorTableForConhost(const gsl::span<COLORREF> table);
|
||||
|
||||
@@ -51,15 +51,15 @@ GUID Utils::CreateGuid()
|
||||
// - color: the COLORREF to create the string for
|
||||
// Return Value:
|
||||
// - a string representation of the color
|
||||
std::string Utils::ColorToHexString(const til::color color)
|
||||
std::string Utils::ColorToHexString(const COLORREF color)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "#" << std::uppercase << std::setfill('0') << std::hex;
|
||||
// Force the compiler to promote from byte to int. Without it, the
|
||||
// stringstream will try to write the components as chars
|
||||
ss << std::setw(2) << static_cast<int>(color.r);
|
||||
ss << std::setw(2) << static_cast<int>(color.g);
|
||||
ss << std::setw(2) << static_cast<int>(color.b);
|
||||
ss << std::setw(2) << static_cast<int>(GetRValue(color));
|
||||
ss << std::setw(2) << static_cast<int>(GetGValue(color));
|
||||
ss << std::setw(2) << static_cast<int>(GetBValue(color));
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ std::string Utils::ColorToHexString(const til::color color)
|
||||
// Return Value:
|
||||
// - A COLORREF if the string could successfully be parsed. If the string is not
|
||||
// the correct format, throws E_INVALIDARG
|
||||
til::color Utils::ColorFromHexString(const std::string_view str)
|
||||
COLORREF Utils::ColorFromHexString(const std::string str)
|
||||
{
|
||||
THROW_HR_IF(E_INVALIDARG, str.size() != 7 && str.size() != 4);
|
||||
THROW_HR_IF(E_INVALIDARG, str.at(0) != '#');
|
||||
@@ -96,7 +96,7 @@ til::color Utils::ColorFromHexString(const std::string_view str)
|
||||
const BYTE g = gsl::narrow_cast<BYTE>(std::stoul(gStr, nullptr, 16));
|
||||
const BYTE b = gsl::narrow_cast<BYTE>(std::stoul(bStr, nullptr, 16));
|
||||
|
||||
return til::color{ r, g, b };
|
||||
return RGB(r, g, b);
|
||||
}
|
||||
|
||||
// Routine Description:
|
||||
@@ -122,22 +122,22 @@ void Utils::InitializeCampbellColorTable(const gsl::span<COLORREF> table)
|
||||
THROW_HR_IF(E_INVALIDARG, table.size() < 16);
|
||||
|
||||
// clang-format off
|
||||
table[0] = RGB(12, 12, 12);
|
||||
table[1] = RGB(197, 15, 31);
|
||||
table[2] = RGB(19, 161, 14);
|
||||
table[3] = RGB(193, 156, 0);
|
||||
table[4] = RGB(0, 55, 218);
|
||||
table[5] = RGB(136, 23, 152);
|
||||
table[6] = RGB(58, 150, 221);
|
||||
table[7] = RGB(204, 204, 204);
|
||||
table[8] = RGB(118, 118, 118);
|
||||
table[9] = RGB(231, 72, 86);
|
||||
table[10] = RGB(22, 198, 12);
|
||||
table[11] = RGB(249, 241, 165);
|
||||
table[12] = RGB(59, 120, 255);
|
||||
table[13] = RGB(180, 0, 158);
|
||||
table[14] = RGB(97, 214, 214);
|
||||
table[15] = RGB(242, 242, 242);
|
||||
table[0] = RGB( 12, 12, 12);
|
||||
table[1] = RGB( 197, 15, 31);
|
||||
table[2] = RGB( 19, 161, 14);
|
||||
table[3] = RGB( 193, 156, 0);
|
||||
table[4] = RGB( 0, 55, 218);
|
||||
table[5] = RGB( 136, 23, 152);
|
||||
table[6] = RGB( 58, 150, 221);
|
||||
table[7] = RGB( 204, 204, 204);
|
||||
table[8] = RGB( 118, 118, 118);
|
||||
table[9] = RGB( 231, 72, 86);
|
||||
table[10] = RGB( 22, 198, 12);
|
||||
table[11] = RGB( 249, 241, 165);
|
||||
table[12] = RGB( 59, 120, 255);
|
||||
table[13] = RGB( 180, 0, 158);
|
||||
table[14] = RGB( 97, 214, 214);
|
||||
table[15] = RGB( 242, 242, 242);
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
@@ -182,106 +182,106 @@ void Utils::Initialize256ColorTable(const gsl::span<COLORREF> table)
|
||||
THROW_HR_IF(E_INVALIDARG, table.size() < 256);
|
||||
|
||||
// clang-format off
|
||||
table[0] = RGB(0x00, 0x00, 0x00);
|
||||
table[1] = RGB(0x80, 0x00, 0x00);
|
||||
table[2] = RGB(0x00, 0x80, 0x00);
|
||||
table[3] = RGB(0x80, 0x80, 0x00);
|
||||
table[4] = RGB(0x00, 0x00, 0x80);
|
||||
table[5] = RGB(0x80, 0x00, 0x80);
|
||||
table[6] = RGB(0x00, 0x80, 0x80);
|
||||
table[7] = RGB(0xc0, 0xc0, 0xc0);
|
||||
table[8] = RGB(0x80, 0x80, 0x80);
|
||||
table[9] = RGB(0xff, 0x00, 0x00);
|
||||
table[10] = RGB(0x00, 0xff, 0x00);
|
||||
table[11] = RGB(0xff, 0xff, 0x00);
|
||||
table[12] = RGB(0x00, 0x00, 0xff);
|
||||
table[13] = RGB(0xff, 0x00, 0xff);
|
||||
table[14] = RGB(0x00, 0xff, 0xff);
|
||||
table[15] = RGB(0xff, 0xff, 0xff);
|
||||
table[16] = RGB(0x00, 0x00, 0x00);
|
||||
table[17] = RGB(0x00, 0x00, 0x5f);
|
||||
table[18] = RGB(0x00, 0x00, 0x87);
|
||||
table[19] = RGB(0x00, 0x00, 0xaf);
|
||||
table[20] = RGB(0x00, 0x00, 0xd7);
|
||||
table[21] = RGB(0x00, 0x00, 0xff);
|
||||
table[22] = RGB(0x00, 0x5f, 0x00);
|
||||
table[23] = RGB(0x00, 0x5f, 0x5f);
|
||||
table[24] = RGB(0x00, 0x5f, 0x87);
|
||||
table[25] = RGB(0x00, 0x5f, 0xaf);
|
||||
table[26] = RGB(0x00, 0x5f, 0xd7);
|
||||
table[27] = RGB(0x00, 0x5f, 0xff);
|
||||
table[28] = RGB(0x00, 0x87, 0x00);
|
||||
table[29] = RGB(0x00, 0x87, 0x5f);
|
||||
table[30] = RGB(0x00, 0x87, 0x87);
|
||||
table[31] = RGB(0x00, 0x87, 0xaf);
|
||||
table[32] = RGB(0x00, 0x87, 0xd7);
|
||||
table[33] = RGB(0x00, 0x87, 0xff);
|
||||
table[34] = RGB(0x00, 0xaf, 0x00);
|
||||
table[35] = RGB(0x00, 0xaf, 0x5f);
|
||||
table[36] = RGB(0x00, 0xaf, 0x87);
|
||||
table[37] = RGB(0x00, 0xaf, 0xaf);
|
||||
table[38] = RGB(0x00, 0xaf, 0xd7);
|
||||
table[39] = RGB(0x00, 0xaf, 0xff);
|
||||
table[40] = RGB(0x00, 0xd7, 0x00);
|
||||
table[41] = RGB(0x00, 0xd7, 0x5f);
|
||||
table[42] = RGB(0x00, 0xd7, 0x87);
|
||||
table[43] = RGB(0x00, 0xd7, 0xaf);
|
||||
table[44] = RGB(0x00, 0xd7, 0xd7);
|
||||
table[45] = RGB(0x00, 0xd7, 0xff);
|
||||
table[46] = RGB(0x00, 0xff, 0x00);
|
||||
table[47] = RGB(0x00, 0xff, 0x5f);
|
||||
table[48] = RGB(0x00, 0xff, 0x87);
|
||||
table[49] = RGB(0x00, 0xff, 0xaf);
|
||||
table[50] = RGB(0x00, 0xff, 0xd7);
|
||||
table[51] = RGB(0x00, 0xff, 0xff);
|
||||
table[52] = RGB(0x5f, 0x00, 0x00);
|
||||
table[53] = RGB(0x5f, 0x00, 0x5f);
|
||||
table[54] = RGB(0x5f, 0x00, 0x87);
|
||||
table[55] = RGB(0x5f, 0x00, 0xaf);
|
||||
table[56] = RGB(0x5f, 0x00, 0xd7);
|
||||
table[57] = RGB(0x5f, 0x00, 0xff);
|
||||
table[58] = RGB(0x5f, 0x5f, 0x00);
|
||||
table[59] = RGB(0x5f, 0x5f, 0x5f);
|
||||
table[60] = RGB(0x5f, 0x5f, 0x87);
|
||||
table[61] = RGB(0x5f, 0x5f, 0xaf);
|
||||
table[62] = RGB(0x5f, 0x5f, 0xd7);
|
||||
table[63] = RGB(0x5f, 0x5f, 0xff);
|
||||
table[64] = RGB(0x5f, 0x87, 0x00);
|
||||
table[65] = RGB(0x5f, 0x87, 0x5f);
|
||||
table[66] = RGB(0x5f, 0x87, 0x87);
|
||||
table[67] = RGB(0x5f, 0x87, 0xaf);
|
||||
table[68] = RGB(0x5f, 0x87, 0xd7);
|
||||
table[69] = RGB(0x5f, 0x87, 0xff);
|
||||
table[70] = RGB(0x5f, 0xaf, 0x00);
|
||||
table[71] = RGB(0x5f, 0xaf, 0x5f);
|
||||
table[72] = RGB(0x5f, 0xaf, 0x87);
|
||||
table[73] = RGB(0x5f, 0xaf, 0xaf);
|
||||
table[74] = RGB(0x5f, 0xaf, 0xd7);
|
||||
table[75] = RGB(0x5f, 0xaf, 0xff);
|
||||
table[76] = RGB(0x5f, 0xd7, 0x00);
|
||||
table[77] = RGB(0x5f, 0xd7, 0x5f);
|
||||
table[78] = RGB(0x5f, 0xd7, 0x87);
|
||||
table[79] = RGB(0x5f, 0xd7, 0xaf);
|
||||
table[80] = RGB(0x5f, 0xd7, 0xd7);
|
||||
table[81] = RGB(0x5f, 0xd7, 0xff);
|
||||
table[82] = RGB(0x5f, 0xff, 0x00);
|
||||
table[83] = RGB(0x5f, 0xff, 0x5f);
|
||||
table[84] = RGB(0x5f, 0xff, 0x87);
|
||||
table[85] = RGB(0x5f, 0xff, 0xaf);
|
||||
table[86] = RGB(0x5f, 0xff, 0xd7);
|
||||
table[87] = RGB(0x5f, 0xff, 0xff);
|
||||
table[88] = RGB(0x87, 0x00, 0x00);
|
||||
table[89] = RGB(0x87, 0x00, 0x5f);
|
||||
table[90] = RGB(0x87, 0x00, 0x87);
|
||||
table[91] = RGB(0x87, 0x00, 0xaf);
|
||||
table[92] = RGB(0x87, 0x00, 0xd7);
|
||||
table[93] = RGB(0x87, 0x00, 0xff);
|
||||
table[94] = RGB(0x87, 0x5f, 0x00);
|
||||
table[95] = RGB(0x87, 0x5f, 0x5f);
|
||||
table[96] = RGB(0x87, 0x5f, 0x87);
|
||||
table[97] = RGB(0x87, 0x5f, 0xaf);
|
||||
table[98] = RGB(0x87, 0x5f, 0xd7);
|
||||
table[99] = RGB(0x87, 0x5f, 0xff);
|
||||
table[0] = RGB( 0x00, 0x00, 0x00);
|
||||
table[1] = RGB( 0x80, 0x00, 0x00);
|
||||
table[2] = RGB( 0x00, 0x80, 0x00);
|
||||
table[3] = RGB( 0x80, 0x80, 0x00);
|
||||
table[4] = RGB( 0x00, 0x00, 0x80);
|
||||
table[5] = RGB( 0x80, 0x00, 0x80);
|
||||
table[6] = RGB( 0x00, 0x80, 0x80);
|
||||
table[7] = RGB( 0xc0, 0xc0, 0xc0);
|
||||
table[8] = RGB( 0x80, 0x80, 0x80);
|
||||
table[9] = RGB( 0xff, 0x00, 0x00);
|
||||
table[10] = RGB( 0x00, 0xff, 0x00);
|
||||
table[11] = RGB( 0xff, 0xff, 0x00);
|
||||
table[12] = RGB( 0x00, 0x00, 0xff);
|
||||
table[13] = RGB( 0xff, 0x00, 0xff);
|
||||
table[14] = RGB( 0x00, 0xff, 0xff);
|
||||
table[15] = RGB( 0xff, 0xff, 0xff);
|
||||
table[16] = RGB( 0x00, 0x00, 0x00);
|
||||
table[17] = RGB( 0x00, 0x00, 0x5f);
|
||||
table[18] = RGB( 0x00, 0x00, 0x87);
|
||||
table[19] = RGB( 0x00, 0x00, 0xaf);
|
||||
table[20] = RGB( 0x00, 0x00, 0xd7);
|
||||
table[21] = RGB( 0x00, 0x00, 0xff);
|
||||
table[22] = RGB( 0x00, 0x5f, 0x00);
|
||||
table[23] = RGB( 0x00, 0x5f, 0x5f);
|
||||
table[24] = RGB( 0x00, 0x5f, 0x87);
|
||||
table[25] = RGB( 0x00, 0x5f, 0xaf);
|
||||
table[26] = RGB( 0x00, 0x5f, 0xd7);
|
||||
table[27] = RGB( 0x00, 0x5f, 0xff);
|
||||
table[28] = RGB( 0x00, 0x87, 0x00);
|
||||
table[29] = RGB( 0x00, 0x87, 0x5f);
|
||||
table[30] = RGB( 0x00, 0x87, 0x87);
|
||||
table[31] = RGB( 0x00, 0x87, 0xaf);
|
||||
table[32] = RGB( 0x00, 0x87, 0xd7);
|
||||
table[33] = RGB( 0x00, 0x87, 0xff);
|
||||
table[34] = RGB( 0x00, 0xaf, 0x00);
|
||||
table[35] = RGB( 0x00, 0xaf, 0x5f);
|
||||
table[36] = RGB( 0x00, 0xaf, 0x87);
|
||||
table[37] = RGB( 0x00, 0xaf, 0xaf);
|
||||
table[38] = RGB( 0x00, 0xaf, 0xd7);
|
||||
table[39] = RGB( 0x00, 0xaf, 0xff);
|
||||
table[40] = RGB( 0x00, 0xd7, 0x00);
|
||||
table[41] = RGB( 0x00, 0xd7, 0x5f);
|
||||
table[42] = RGB( 0x00, 0xd7, 0x87);
|
||||
table[43] = RGB( 0x00, 0xd7, 0xaf);
|
||||
table[44] = RGB( 0x00, 0xd7, 0xd7);
|
||||
table[45] = RGB( 0x00, 0xd7, 0xff);
|
||||
table[46] = RGB( 0x00, 0xff, 0x00);
|
||||
table[47] = RGB( 0x00, 0xff, 0x5f);
|
||||
table[48] = RGB( 0x00, 0xff, 0x87);
|
||||
table[49] = RGB( 0x00, 0xff, 0xaf);
|
||||
table[50] = RGB( 0x00, 0xff, 0xd7);
|
||||
table[51] = RGB( 0x00, 0xff, 0xff);
|
||||
table[52] = RGB( 0x5f, 0x00, 0x00);
|
||||
table[53] = RGB( 0x5f, 0x00, 0x5f);
|
||||
table[54] = RGB( 0x5f, 0x00, 0x87);
|
||||
table[55] = RGB( 0x5f, 0x00, 0xaf);
|
||||
table[56] = RGB( 0x5f, 0x00, 0xd7);
|
||||
table[57] = RGB( 0x5f, 0x00, 0xff);
|
||||
table[58] = RGB( 0x5f, 0x5f, 0x00);
|
||||
table[59] = RGB( 0x5f, 0x5f, 0x5f);
|
||||
table[60] = RGB( 0x5f, 0x5f, 0x87);
|
||||
table[61] = RGB( 0x5f, 0x5f, 0xaf);
|
||||
table[62] = RGB( 0x5f, 0x5f, 0xd7);
|
||||
table[63] = RGB( 0x5f, 0x5f, 0xff);
|
||||
table[64] = RGB( 0x5f, 0x87, 0x00);
|
||||
table[65] = RGB( 0x5f, 0x87, 0x5f);
|
||||
table[66] = RGB( 0x5f, 0x87, 0x87);
|
||||
table[67] = RGB( 0x5f, 0x87, 0xaf);
|
||||
table[68] = RGB( 0x5f, 0x87, 0xd7);
|
||||
table[69] = RGB( 0x5f, 0x87, 0xff);
|
||||
table[70] = RGB( 0x5f, 0xaf, 0x00);
|
||||
table[71] = RGB( 0x5f, 0xaf, 0x5f);
|
||||
table[72] = RGB( 0x5f, 0xaf, 0x87);
|
||||
table[73] = RGB( 0x5f, 0xaf, 0xaf);
|
||||
table[74] = RGB( 0x5f, 0xaf, 0xd7);
|
||||
table[75] = RGB( 0x5f, 0xaf, 0xff);
|
||||
table[76] = RGB( 0x5f, 0xd7, 0x00);
|
||||
table[77] = RGB( 0x5f, 0xd7, 0x5f);
|
||||
table[78] = RGB( 0x5f, 0xd7, 0x87);
|
||||
table[79] = RGB( 0x5f, 0xd7, 0xaf);
|
||||
table[80] = RGB( 0x5f, 0xd7, 0xd7);
|
||||
table[81] = RGB( 0x5f, 0xd7, 0xff);
|
||||
table[82] = RGB( 0x5f, 0xff, 0x00);
|
||||
table[83] = RGB( 0x5f, 0xff, 0x5f);
|
||||
table[84] = RGB( 0x5f, 0xff, 0x87);
|
||||
table[85] = RGB( 0x5f, 0xff, 0xaf);
|
||||
table[86] = RGB( 0x5f, 0xff, 0xd7);
|
||||
table[87] = RGB( 0x5f, 0xff, 0xff);
|
||||
table[88] = RGB( 0x87, 0x00, 0x00);
|
||||
table[89] = RGB( 0x87, 0x00, 0x5f);
|
||||
table[90] = RGB( 0x87, 0x00, 0x87);
|
||||
table[91] = RGB( 0x87, 0x00, 0xaf);
|
||||
table[92] = RGB( 0x87, 0x00, 0xd7);
|
||||
table[93] = RGB( 0x87, 0x00, 0xff);
|
||||
table[94] = RGB( 0x87, 0x5f, 0x00);
|
||||
table[95] = RGB( 0x87, 0x5f, 0x5f);
|
||||
table[96] = RGB( 0x87, 0x5f, 0x87);
|
||||
table[97] = RGB( 0x87, 0x5f, 0xaf);
|
||||
table[98] = RGB( 0x87, 0x5f, 0xd7);
|
||||
table[99] = RGB( 0x87, 0x5f, 0xff);
|
||||
table[100] = RGB(0x87, 0x87, 0x00);
|
||||
table[101] = RGB(0x87, 0x87, 0x5f);
|
||||
table[102] = RGB(0x87, 0x87, 0x87);
|
||||
@@ -360,24 +360,24 @@ void Utils::Initialize256ColorTable(const gsl::span<COLORREF> table)
|
||||
table[175] = RGB(0xd7, 0x87, 0xaf);
|
||||
table[176] = RGB(0xd7, 0x87, 0xd7);
|
||||
table[177] = RGB(0xd7, 0x87, 0xff);
|
||||
table[178] = RGB(0xd7, 0xaf, 0x00);
|
||||
table[179] = RGB(0xd7, 0xaf, 0x5f);
|
||||
table[180] = RGB(0xd7, 0xaf, 0x87);
|
||||
table[181] = RGB(0xd7, 0xaf, 0xaf);
|
||||
table[182] = RGB(0xd7, 0xaf, 0xd7);
|
||||
table[183] = RGB(0xd7, 0xaf, 0xff);
|
||||
table[184] = RGB(0xd7, 0xd7, 0x00);
|
||||
table[185] = RGB(0xd7, 0xd7, 0x5f);
|
||||
table[186] = RGB(0xd7, 0xd7, 0x87);
|
||||
table[187] = RGB(0xd7, 0xd7, 0xaf);
|
||||
table[188] = RGB(0xd7, 0xd7, 0xd7);
|
||||
table[189] = RGB(0xd7, 0xd7, 0xff);
|
||||
table[190] = RGB(0xd7, 0xff, 0x00);
|
||||
table[191] = RGB(0xd7, 0xff, 0x5f);
|
||||
table[192] = RGB(0xd7, 0xff, 0x87);
|
||||
table[193] = RGB(0xd7, 0xff, 0xaf);
|
||||
table[194] = RGB(0xd7, 0xff, 0xd7);
|
||||
table[195] = RGB(0xd7, 0xff, 0xff);
|
||||
table[178] = RGB(0xdf, 0xaf, 0x00);
|
||||
table[179] = RGB(0xdf, 0xaf, 0x5f);
|
||||
table[180] = RGB(0xdf, 0xaf, 0x87);
|
||||
table[181] = RGB(0xdf, 0xaf, 0xaf);
|
||||
table[182] = RGB(0xdf, 0xaf, 0xd7);
|
||||
table[183] = RGB(0xdf, 0xaf, 0xff);
|
||||
table[184] = RGB(0xdf, 0xd7, 0x00);
|
||||
table[185] = RGB(0xdf, 0xd7, 0x5f);
|
||||
table[186] = RGB(0xdf, 0xd7, 0x87);
|
||||
table[187] = RGB(0xdf, 0xd7, 0xaf);
|
||||
table[188] = RGB(0xdf, 0xd7, 0xd7);
|
||||
table[189] = RGB(0xdf, 0xd7, 0xff);
|
||||
table[190] = RGB(0xdf, 0xff, 0x00);
|
||||
table[191] = RGB(0xdf, 0xff, 0x5f);
|
||||
table[192] = RGB(0xdf, 0xff, 0x87);
|
||||
table[193] = RGB(0xdf, 0xff, 0xaf);
|
||||
table[194] = RGB(0xdf, 0xff, 0xd7);
|
||||
table[195] = RGB(0xdf, 0xff, 0xff);
|
||||
table[196] = RGB(0xff, 0x00, 0x00);
|
||||
table[197] = RGB(0xff, 0x00, 0x5f);
|
||||
table[198] = RGB(0xff, 0x00, 0x87);
|
||||
|
||||
@@ -97,8 +97,9 @@ set MSBuildEmitSolution=1
|
||||
set MSBuildEmitSolution=
|
||||
|
||||
rem Use bx.ps1 to figure out which target we're looking at
|
||||
set _BX_SCRIPT=powershell bx.ps1
|
||||
set _OUTPUT=
|
||||
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive bx.ps1 2^> NUL`) DO (
|
||||
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell bx.ps1 2^> NUL`) DO (
|
||||
set _OUTPUT=%%F
|
||||
)
|
||||
if "!_OUTPUT!" == "" (
|
||||
|
||||
Reference in New Issue
Block a user