mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-07 14:50:55 +00:00
Compare commits
3 Commits
cinnamon/o
...
dev/miniks
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dc02fe1a0 | ||
|
|
2171d77855 | ||
|
|
c1ca8f346d |
7
.github/workflows/linter.yml
vendored
7
.github/workflows/linter.yml
vendored
@@ -37,15 +37,12 @@ jobs:
|
||||
##########################
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
################################
|
||||
# Run Linter against code base #
|
||||
################################
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter@v3
|
||||
uses: github/super-linter@v3.10.0
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
DEFAULT_BRANCH: master
|
||||
|
||||
@@ -172,7 +172,6 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsTerminal", "src\cascadia\WindowsTerminal\WindowsTerminal.vcxproj", "{CA5CAD1A-1754-4A9D-93D7-857A9D17CB1B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12} = {CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12}
|
||||
{CA5CAD1A-ABCD-429C-B551-8562EC954746} = {CA5CAD1A-ABCD-429C-B551-8562EC954746}
|
||||
{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B} = {9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}
|
||||
@@ -181,7 +180,6 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalApp", "src\cascadia\TerminalApp\dll\TerminalApp.vcxproj", "{CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-9A12-429C-B551-8562EC954746} = {CA5CAD1A-9A12-429C-B551-8562EC954746}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B} = {CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
@@ -235,7 +233,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAppLib", "src\casca
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LocalTests_TerminalApp", "src\cascadia\LocalTests_TerminalApp\TerminalApp.LocalTests.vcxproj", "{CA5CAD1A-B11C-4DDB-A4FE-C3AFAE9B5506}"
|
||||
@@ -318,11 +315,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfTerminalTestNetCore", "s
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wt", "src\cascadia\wt\wt.vcxproj", "{506FD703-BAA7-4F6E-9361-64F550EC8FCA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Settings.Editor", "src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj", "{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Settings.Model.Lib", "src\cascadia\TerminalSettingsModel\Microsoft.Terminal.Settings.ModelLib.vcxproj", "{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
|
||||
@@ -2020,45 +2012,6 @@ Global
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x64.Build.0 = Release|x64
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.ActiveCfg = Release|Win32
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|ARM64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x64Test.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|DotNet_x86Test.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|x86.Deploy.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|DotNet_x64Test.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.Build.0 = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.Build.0 = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|DotNet_x64Test.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.ActiveCfg = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.Build.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x64.Deploy.0 = Release|x64
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.Build.0 = Release|Win32
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.Release|x86.Deploy.0 = Release|Win32
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
|
||||
@@ -2217,7 +2170,6 @@ Global
|
||||
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
|
||||
{1588FD7C-241E-4E7D-9113-43735F3E6BAD} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{506FD703-BAA7-4F6E-9361-64F550EC8FCA} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-082C-4476-9F33-94B339494076} = {59840756-302F-44DF-AA47-441A9D673202}
|
||||
{CA5CAD1A-9B68-456A-B13E-C8218070DC42} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
|
||||
|
||||
@@ -79,7 +79,6 @@ page](https://chocolatey.org/packages/microsoft-windows-terminal) and follow the
|
||||
release by installing the `windows-terminal` package:
|
||||
|
||||
```powershell
|
||||
scoop bucket add extras
|
||||
scoop install windows-terminal
|
||||
```
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Preview'">WT_BRANDING_PREVIEW</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Release'">WT_BRANDING_RELEASE</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(_WTBrandingPreprocessorToken)'==''">WT_BRANDING_DEV</_WTBrandingPreprocessorToken>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>$(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
@@ -2281,35 +2281,32 @@ std::wstring TextBuffer::GetHyperlinkUriFromId(uint16_t id) const
|
||||
// - The user-defined id
|
||||
// Return value:
|
||||
// - The internal hyperlink ID
|
||||
uint16_t TextBuffer::GetHyperlinkId(std::wstring_view uri, std::wstring_view id)
|
||||
uint16_t TextBuffer::GetHyperlinkId(std::wstring_view params)
|
||||
{
|
||||
uint16_t numericId = 0;
|
||||
if (id.empty())
|
||||
uint16_t id = 0;
|
||||
if (params.empty())
|
||||
{
|
||||
// no custom id specified, return our internal count
|
||||
numericId = _currentHyperlinkId;
|
||||
id = _currentHyperlinkId;
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// assign _currentHyperlinkId if the custom id does not already exist
|
||||
std::wstring newId{ id };
|
||||
// hash the URL and add it to the custom ID - GH#7698
|
||||
newId += L"%" + std::to_wstring(std::hash<std::wstring_view>{}(uri));
|
||||
const auto result = _hyperlinkCustomIdMap.emplace(newId, _currentHyperlinkId);
|
||||
const auto result = _hyperlinkCustomIdMap.emplace(params, _currentHyperlinkId);
|
||||
if (result.second)
|
||||
{
|
||||
// the custom id did not already exist
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
numericId = (*(result.first)).second;
|
||||
id = (*(result.first)).second;
|
||||
}
|
||||
// _currentHyperlinkId could overflow, make sure its not 0
|
||||
if (_currentHyperlinkId == 0)
|
||||
{
|
||||
++_currentHyperlinkId;
|
||||
}
|
||||
return numericId;
|
||||
return id;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
void AddHyperlinkToMap(std::wstring_view uri, uint16_t id);
|
||||
std::wstring GetHyperlinkUriFromId(uint16_t id) const;
|
||||
uint16_t GetHyperlinkId(std::wstring_view uri, std::wstring_view id);
|
||||
uint16_t GetHyperlinkId(std::wstring_view params);
|
||||
void RemoveHyperlinkFromMap(uint16_t id);
|
||||
std::wstring GetCustomIdFromId(uint16_t id) const;
|
||||
void CopyHyperlinkMaps(const TextBuffer& OtherBuffer);
|
||||
|
||||
@@ -80,8 +80,6 @@ namespace SettingsModelLocalTests
|
||||
TEST_METHOD(TestUnbindNestedCommand);
|
||||
TEST_METHOD(TestRebindNestedCommand);
|
||||
|
||||
TEST_METHOD(TestCopy);
|
||||
|
||||
TEST_CLASS_SETUP(ClassSetup)
|
||||
{
|
||||
InitializeJsonReader();
|
||||
@@ -2372,92 +2370,4 @@ namespace SettingsModelLocalTests
|
||||
}
|
||||
}
|
||||
|
||||
void DeserializationTests::TestCopy()
|
||||
{
|
||||
const std::string settingsJson{ R"(
|
||||
{
|
||||
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"initialCols": 50,
|
||||
"profiles":
|
||||
[
|
||||
{
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"name": "Custom Profile",
|
||||
"fontFace": "Cascadia Code"
|
||||
}
|
||||
],
|
||||
"schemes":
|
||||
[
|
||||
{
|
||||
"name": "Campbell, but for a test",
|
||||
"foreground": "#CCCCCC",
|
||||
"background": "#0C0C0C",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"black": "#0C0C0C",
|
||||
"red": "#C50F1F",
|
||||
"green": "#13A10E",
|
||||
"yellow": "#C19C00",
|
||||
"blue": "#0037DA",
|
||||
"purple": "#881798",
|
||||
"cyan": "#3A96DD",
|
||||
"white": "#CCCCCC",
|
||||
"brightBlack": "#767676",
|
||||
"brightRed": "#E74856",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightWhite": "#F2F2F2"
|
||||
}
|
||||
],
|
||||
"actions":
|
||||
[
|
||||
{ "command": "openSettings", "keys": "ctrl+," },
|
||||
{ "command": { "action": "openSettings", "target": "defaultsFile" }, "keys": "ctrl+alt+," },
|
||||
|
||||
{
|
||||
"name": { "key": "SetColorSchemeParentCommandName" },
|
||||
"commands": [
|
||||
{
|
||||
"iterateOn": "schemes",
|
||||
"name": "${scheme.name}",
|
||||
"command": { "action": "setColorScheme", "colorScheme": "${scheme.name}" }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
VerifyParseSucceeded(settingsJson);
|
||||
|
||||
auto settings{ winrt::make_self<implementation::CascadiaSettings>() };
|
||||
settings->_ParseJsonString(settingsJson, false);
|
||||
settings->LayerJson(settings->_userSettings);
|
||||
settings->_ValidateSettings();
|
||||
|
||||
const auto copy{ settings->Copy() };
|
||||
const auto copyImpl{ winrt::get_self<implementation::CascadiaSettings>(copy) };
|
||||
|
||||
// test globals
|
||||
VERIFY_ARE_EQUAL(settings->_globals->DefaultProfile(), copyImpl->_globals->DefaultProfile());
|
||||
|
||||
// test profiles
|
||||
VERIFY_ARE_EQUAL(settings->_profiles.Size(), copyImpl->_profiles.Size());
|
||||
VERIFY_ARE_EQUAL(settings->_profiles.GetAt(0).Name(), copyImpl->_profiles.GetAt(0).Name());
|
||||
|
||||
// test schemes
|
||||
const auto schemeName{ L"Campbell, but for a test" };
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_colorSchemes.Size(), copyImpl->_globals->_colorSchemes.Size());
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_colorSchemes.HasKey(schemeName), copyImpl->_globals->_colorSchemes.HasKey(schemeName));
|
||||
|
||||
// test actions
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_keymap->_keyShortcuts.size(), copyImpl->_globals->_keymap->_keyShortcuts.size());
|
||||
VERIFY_ARE_EQUAL(settings->_globals->_commands.Size(), copyImpl->_globals->_commands.Size());
|
||||
|
||||
// Test that changing the copy should not change the original
|
||||
VERIFY_ARE_EQUAL(settings->_globals->WordDelimiters(), copyImpl->_globals->WordDelimiters());
|
||||
copyImpl->_globals->WordDelimiters(L"changed value");
|
||||
VERIFY_ARE_NOT_EQUAL(settings->_globals->WordDelimiters(), copyImpl->_globals->WordDelimiters());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "../TerminalApp/MinMaxCloseControl.h"
|
||||
#include "../TerminalApp/TabRowControl.h"
|
||||
#include "../TerminalApp/ShortcutActionDispatch.h"
|
||||
#include "../TerminalApp/TerminalTab.h"
|
||||
#include "../TerminalApp/Tab.h"
|
||||
#include "../CppWinrtTailored.h"
|
||||
|
||||
using namespace Microsoft::Console;
|
||||
@@ -62,10 +62,6 @@ namespace TerminalAppLocalTests
|
||||
TEST_METHOD(TryDuplicateBadTab);
|
||||
TEST_METHOD(TryDuplicateBadPane);
|
||||
|
||||
TEST_METHOD(TryZoomPane);
|
||||
TEST_METHOD(MoveFocusFromZoomedPane);
|
||||
TEST_METHOD(CloseZoomedPane);
|
||||
|
||||
TEST_CLASS_SETUP(ClassSetup)
|
||||
{
|
||||
return true;
|
||||
@@ -79,7 +75,6 @@ namespace TerminalAppLocalTests
|
||||
private:
|
||||
void _initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
|
||||
CascadiaSettings initialSettings);
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> _commonSetup();
|
||||
};
|
||||
|
||||
void TabTests::EnsureTestsActivate()
|
||||
@@ -250,8 +245,8 @@ namespace TerminalAppLocalTests
|
||||
// In the real app, this isn't a problem, but doesn't happen
|
||||
// reliably in the unit tests.
|
||||
Log::Comment(L"Ensure we set the first tab as the selected one.");
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
page->_tabView.SelectedItem(tab->TabViewItem());
|
||||
auto tab{ page->_GetStrongTabImpl(0) };
|
||||
page->_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
page->_UpdatedSelectedTab(0);
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -453,7 +448,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
result = RunOnUIThread([&page]() {
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(1, tab->GetLeafPaneCount());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -463,7 +458,7 @@ namespace TerminalAppLocalTests
|
||||
page->_SplitPane(SplitState::Automatic, SplitType::Duplicate, nullptr);
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, tab->GetLeafPaneCount());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -481,7 +476,7 @@ namespace TerminalAppLocalTests
|
||||
page->_SplitPane(SplitState::Automatic, SplitType::Duplicate, nullptr);
|
||||
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
auto tab = page->_GetTerminalTabImpl(page->_tabs.GetAt(0));
|
||||
auto tab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2,
|
||||
tab->GetLeafPaneCount(),
|
||||
L"We should gracefully do nothing here - the profile no longer exists.");
|
||||
@@ -501,192 +496,4 @@ namespace TerminalAppLocalTests
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - This is a helper method for setting up a TerminalPage with some common
|
||||
// settings, and creating the first tab.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The initialized TerminalPage, ready to use.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> TabTests::_commonSetup()
|
||||
{
|
||||
const std::string settingsJson0{ R"(
|
||||
{
|
||||
"defaultProfile": "{6239a42c-1111-49a3-80bd-e8fdd045185c}",
|
||||
"profiles": [
|
||||
{
|
||||
"name" : "profile0",
|
||||
"guid": "{6239a42c-1111-49a3-80bd-e8fdd045185c}",
|
||||
"historySize": 1
|
||||
},
|
||||
{
|
||||
"name" : "profile1",
|
||||
"guid": "{6239a42c-2222-49a3-80bd-e8fdd045185c}",
|
||||
"historySize": 2
|
||||
}
|
||||
]
|
||||
})" };
|
||||
|
||||
CascadiaSettings settings0{ til::u8u16(settingsJson0) };
|
||||
VERIFY_IS_NOT_NULL(settings0);
|
||||
|
||||
const auto guid1 = Microsoft::Console::Utils::GuidFromString(L"{6239a42c-1111-49a3-80bd-e8fdd045185c}");
|
||||
const auto guid2 = Microsoft::Console::Utils::GuidFromString(L"{6239a42c-2222-49a3-80bd-e8fdd045185c}");
|
||||
|
||||
// This is super wacky, but we can't just initialize the
|
||||
// com_ptr<impl::TerminalPage> in the lambda and assign it back out of
|
||||
// the lambda. We'll crash trying to get a weak_ref to the TerminalPage
|
||||
// during TerminalPage::Create() below.
|
||||
//
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
VERIFY_ARE_EQUAL(1u, page->_tabs.Size());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
void TabTests::TryZoomPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
// eventArgs.Args(args);
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
ActionEventArgs eventArgs{};
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom out of the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
ActionEventArgs eventArgs{};
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
|
||||
void TabTests::MoveFocusFromZoomedPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Move focus. This will cause us to un-zoom.");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
MoveFocusArgs args{ Direction::Left };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
|
||||
page->_HandleMoveFocus(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
|
||||
void TabTests::CloseZoomedPane()
|
||||
{
|
||||
auto page = _commonSetup();
|
||||
|
||||
Log::Comment(L"Create a second pane");
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
SplitPaneArgs args{ SplitType::Duplicate };
|
||||
ActionEventArgs eventArgs{ args };
|
||||
page->_HandleSplitPane(nullptr, eventArgs);
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Zoom in on the pane");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleTogglePaneZoom(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(2, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_TRUE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
Log::Comment(L"Close Pane. This should cause us to un-zoom, and remove the second pane from the tree");
|
||||
result = RunOnUIThread([&page]() {
|
||||
// Set up action
|
||||
ActionEventArgs eventArgs{};
|
||||
|
||||
page->_HandleClosePane(nullptr, eventArgs);
|
||||
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
|
||||
// Introduce a slight delay to let the events finish propagating
|
||||
Sleep(250);
|
||||
|
||||
Log::Comment(L"Check to ensure there's only one pane left.");
|
||||
|
||||
result = RunOnUIThread([&page]() {
|
||||
auto firstTab = page->_GetStrongTabImpl(0);
|
||||
VERIFY_ARE_EQUAL(1, firstTab->GetLeafPaneCount());
|
||||
VERIFY_IS_FALSE(firstTab->IsZoomed());
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
|
||||
<!-- If you don't reference these projects here, the
|
||||
_ConsoleGenerateAdditionalWinmdManifests step won't gather the winmd's -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\dll\TerminalApp.vcxproj" />
|
||||
|
||||
@@ -94,8 +94,6 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
|
||||
<Project>{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}</Project>
|
||||
</ProjectReference>
|
||||
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalApp\dll\TerminalApp.vcxproj">
|
||||
|
||||
@@ -122,26 +122,22 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleTogglePaneZoom(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
auto activeTab = _GetFocusedTab();
|
||||
|
||||
// Don't do anything if there's only one pane. It's already zoomed.
|
||||
if (activeTab && activeTab->GetLeafPaneCount() > 1)
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
// Don't do anything if there's only one pane. It's already zoomed.
|
||||
if (activeTab && activeTab->GetLeafPaneCount() > 1)
|
||||
{
|
||||
// First thing's first, remove the current content from the UI
|
||||
// tree. This is important, because we might be leaving zoom, and if
|
||||
// a pane is zoomed, then it's currently in the UI tree, and should
|
||||
// be removed before it's re-added in Pane::Restore
|
||||
_tabContent.Children().Clear();
|
||||
// First thing's first, remove the current content from the UI
|
||||
// tree. This is important, because we might be leaving zoom, and if
|
||||
// a pane is zoomed, then it's currently in the UI tree, and should
|
||||
// be removed before it's re-added in Pane::Restore
|
||||
_tabContent.Children().Clear();
|
||||
|
||||
// Togging the zoom on the tab will cause the tab to inform us of
|
||||
// the new root Content for this tab.
|
||||
activeTab->ToggleZoom();
|
||||
}
|
||||
}
|
||||
activeTab->ToggleZoom();
|
||||
|
||||
// Update the selected tab, to trigger us to re-add the tab's GetRootElement to the UI tree
|
||||
_UpdatedSelectedTab(_tabView.SelectedIndex());
|
||||
}
|
||||
|
||||
args.Handled(true);
|
||||
}
|
||||
|
||||
@@ -320,19 +316,16 @@ namespace winrt::TerminalApp::implementation
|
||||
args.Handled(false);
|
||||
if (const auto& realArgs = args.ActionArgs().try_as<SetColorSchemeArgs>())
|
||||
{
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
if (auto activeTab = _GetFocusedTab())
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
if (auto activeControl = activeTab->GetActiveTerminalControl())
|
||||
{
|
||||
if (auto activeControl = activeTab->GetActiveTerminalControl())
|
||||
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
|
||||
{
|
||||
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
|
||||
{
|
||||
auto controlSettings = activeControl.Settings().as<TerminalSettings>();
|
||||
controlSettings->ApplyColorScheme(scheme);
|
||||
activeControl.UpdateSettings(*controlSettings);
|
||||
args.Handled(true);
|
||||
}
|
||||
auto controlSettings = activeControl.Settings().as<TerminalSettings>();
|
||||
controlSettings->ApplyColorScheme(scheme);
|
||||
activeControl.UpdateSettings(*controlSettings);
|
||||
args.Handled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,18 +345,16 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
if (tabColor.has_value())
|
||||
{
|
||||
if (tabColor.has_value())
|
||||
{
|
||||
activeTab->SetRuntimeTabColor(tabColor.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetRuntimeTabColor();
|
||||
}
|
||||
activeTab->SetRuntimeTabColor(tabColor.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetRuntimeTabColor();
|
||||
}
|
||||
}
|
||||
args.Handled(true);
|
||||
@@ -372,12 +363,10 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleOpenTabColorPicker(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
activeTab->ActivateColorPicker();
|
||||
}
|
||||
activeTab->ActivateColorPicker();
|
||||
}
|
||||
args.Handled(true);
|
||||
}
|
||||
@@ -392,18 +381,16 @@ namespace winrt::TerminalApp::implementation
|
||||
title = realArgs.Title();
|
||||
}
|
||||
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab)
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
if (title.has_value())
|
||||
{
|
||||
if (title.has_value())
|
||||
{
|
||||
activeTab->SetTabText(title.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetTabText();
|
||||
}
|
||||
activeTab->SetTabText(title.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
activeTab->ResetTabText();
|
||||
}
|
||||
}
|
||||
args.Handled(true);
|
||||
@@ -502,14 +489,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_HandleOpenTabSearch(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
{
|
||||
// Tab search is always in-order.
|
||||
auto tabCommands = winrt::single_threaded_vector<Command>();
|
||||
for (const auto& tab : _tabs)
|
||||
{
|
||||
tabCommands.Append(tab.SwitchToTabCommand());
|
||||
}
|
||||
CommandPalette().SetTabActions(tabCommands);
|
||||
|
||||
auto opt = _GetFocusedTabIndex();
|
||||
uint32_t startIdx = opt.value_or(0);
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "AppLogic.g.h"
|
||||
|
||||
#include "Tab.h"
|
||||
#include "TerminalPage.h"
|
||||
#include "Jumplist.h"
|
||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||
|
||||
@@ -615,12 +615,6 @@ namespace winrt::TerminalApp::implementation
|
||||
_updateFilteredActions();
|
||||
}
|
||||
|
||||
void CommandPalette::SetTabActions(Collections::IVector<Command> const& tabs)
|
||||
{
|
||||
_allTabActions = tabs;
|
||||
_updateFilteredActions();
|
||||
}
|
||||
|
||||
void CommandPalette::EnableCommandPaletteMode()
|
||||
{
|
||||
_switchToMode(CommandPaletteMode::ActionMode);
|
||||
@@ -982,6 +976,45 @@ namespace winrt::TerminalApp::implementation
|
||||
_currentNestedCommands.Clear();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Listens for changes to TerminalPage's _tabs vector. Updates our vector of
|
||||
// tab switching commands accordingly.
|
||||
// Arguments:
|
||||
// - s: The vector being listened to.
|
||||
// - e: The vector changed args that tells us whether a change, insert, or removal was performed
|
||||
// on the listened-to vector.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::OnTabsChanged(const IInspectable& s, const IVectorChangedEventArgs& e)
|
||||
{
|
||||
if (auto tabList = s.try_as<IObservableVector<TerminalApp::Tab>>())
|
||||
{
|
||||
auto idx = e.Index();
|
||||
auto changedEvent = e.CollectionChange();
|
||||
|
||||
switch (changedEvent)
|
||||
{
|
||||
case CollectionChange::ItemChanged:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case CollectionChange::ItemInserted:
|
||||
{
|
||||
auto tab = tabList.GetAt(idx);
|
||||
_allTabActions.InsertAt(idx, tab.SwitchToTabCommand());
|
||||
break;
|
||||
}
|
||||
case CollectionChange::ItemRemoved:
|
||||
{
|
||||
_allTabActions.RemoveAt(idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_updateFilteredActions();
|
||||
}
|
||||
}
|
||||
|
||||
void CommandPalette::EnableTabSwitcherMode(const bool searchMode, const uint32_t startIdx)
|
||||
{
|
||||
_switcherStartIdx = startIdx;
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace winrt::TerminalApp::implementation
|
||||
Windows::Foundation::Collections::IObservableVector<Microsoft::Terminal::Settings::Model::Command> FilteredActions();
|
||||
|
||||
void SetCommands(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command> const& actions);
|
||||
void SetTabActions(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command> const& tabs);
|
||||
void SetKeyBindings(Microsoft::Terminal::TerminalControl::IKeyBindings bindings);
|
||||
|
||||
void EnableCommandPaletteMode();
|
||||
@@ -36,6 +35,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Tab Switcher
|
||||
void EnableTabSwitcherMode(const bool searchMode, const uint32_t startIdx);
|
||||
void OnTabsChanged(const Windows::Foundation::IInspectable& s, const Windows::Foundation::Collections::IVectorChangedEventArgs& e);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, NoMatchesText, _PropertyChangedHandlers);
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace TerminalApp
|
||||
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Model.Command> FilteredActions { get; };
|
||||
|
||||
void SetCommands(Windows.Foundation.Collections.IVector<Microsoft.Terminal.Settings.Model.Command> actions);
|
||||
void SetTabActions(Windows.Foundation.Collections.IVector<Microsoft.Terminal.Settings.Model.Command> tabs);
|
||||
void SetKeyBindings(Microsoft.Terminal.TerminalControl.IKeyBindings bindings);
|
||||
void EnableCommandPaletteMode();
|
||||
|
||||
@@ -28,5 +27,6 @@ namespace TerminalApp
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
|
||||
void EnableTabSwitcherMode(Boolean searchMode, UInt32 startIdx);
|
||||
void OnTabsChanged(IInspectable s, Windows.Foundation.Collections.IVectorChangedEventArgs e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import "ShortcutActionDispatch.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
interface ITab
|
||||
{
|
||||
String Title { get; };
|
||||
String Icon { get; };
|
||||
Microsoft.Terminal.Settings.Model.Command SwitchToTabCommand;
|
||||
Microsoft.UI.Xaml.Controls.TabViewItem TabViewItem { get; };
|
||||
Windows.UI.Xaml.FrameworkElement Content { get; };
|
||||
Windows.UI.Xaml.FocusState FocusState { get; };
|
||||
|
||||
void Focus(Windows.UI.Xaml.FocusState focusState);
|
||||
void Shutdown();
|
||||
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
}
|
||||
}
|
||||
@@ -702,16 +702,6 @@ void Pane::_CloseChild(const bool closeFirst)
|
||||
if (_lastActive)
|
||||
{
|
||||
_control.Focus(FocusState::Programmatic);
|
||||
|
||||
// See GH#7252
|
||||
// Manually fire off the GotFocus event. Typically, this is done
|
||||
// automatically when the control gets focused. However, if we're
|
||||
// `exit`ing a zoomed pane, then the other sibling isn't in the UI
|
||||
// tree currently. So the above call to Focus won't actually focus
|
||||
// the control. Because Tab is relying on GotFocus to know who the
|
||||
// active pane in the tree is, without this call, _no one_ will be
|
||||
// the active pane any longer.
|
||||
_GotFocusHandlers(shared_from_this());
|
||||
}
|
||||
|
||||
_UpdateBorders();
|
||||
@@ -823,13 +813,11 @@ winrt::fire_and_forget Pane::_CloseChildRoutine(const bool closeFirst)
|
||||
const auto animationsEnabledInOS = uiSettings.AnimationsEnabled();
|
||||
const auto animationsEnabledInApp = Media::Animation::Timeline::AllowDependentAnimations();
|
||||
|
||||
// GH#7252: If either child is zoomed, just skip the animation. It won't work.
|
||||
const bool eitherChildZoomed = pane->_firstChild->_zoomed || pane->_secondChild->_zoomed;
|
||||
// If animations are disabled, just skip this and go straight to
|
||||
// _CloseChild. Curiously, the pane opening animation doesn't need this,
|
||||
// and will skip straight to Completed when animations are disabled, but
|
||||
// this one doesn't seem to.
|
||||
if (!animationsEnabledInOS || !animationsEnabledInApp || eitherChildZoomed)
|
||||
if (!animationsEnabledInOS || !animationsEnabledInApp)
|
||||
{
|
||||
pane->_CloseChild(closeFirst);
|
||||
co_return;
|
||||
|
||||
@@ -469,7 +469,4 @@
|
||||
<data name="CouldNotOpenUriDialog.PrimaryButtonText" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="SettingsTab" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
#include "SettingsTab.h"
|
||||
#include "SettingsTab.g.cpp"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalControl;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Windows::System;
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
namespace MUX = Microsoft::UI::Xaml;
|
||||
namespace WUX = Windows::UI::Xaml;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
SettingsTab::SettingsTab(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings)
|
||||
{
|
||||
Content(winrt::Microsoft::Terminal::Settings::Editor::MainPage(settings));
|
||||
|
||||
_MakeTabViewItem();
|
||||
_CreateContextMenu();
|
||||
_CreateIcon();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Initializes a TabViewItem for this Tab instance.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_MakeTabViewItem()
|
||||
{
|
||||
TabViewItem(::winrt::MUX::Controls::TabViewItem{});
|
||||
Title(RS_(L"SettingsTab"));
|
||||
TabViewItem().Header(winrt::box_value(Title()));
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Focus the settings UI
|
||||
// Arguments:
|
||||
// - focusState: The FocusState mode by which focus is to be obtained.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::Focus(WUX::FocusState focusState)
|
||||
{
|
||||
_focusState = focusState;
|
||||
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
{
|
||||
Content().Focus(focusState);
|
||||
}
|
||||
}
|
||||
|
||||
WUX::FocusState SettingsTab::FocusState() const noexcept
|
||||
{
|
||||
return _focusState;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Set the icon on the TabViewItem for this tab.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget SettingsTab::_CreateIcon()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
auto fontFamily = winrt::WUX::Media::FontFamily(L"Segoe MDL2 Assets");
|
||||
auto glyph = L"\xE713"; // This is the Setting icon (looks like a gear)
|
||||
|
||||
// The TabViewItem Icon needs MUX while the IconSourceElement in the CommandPalette needs WUX...
|
||||
Icon(glyph);
|
||||
TabViewItem().IconSource(IconPathConverter::IconSourceMUX(glyph));
|
||||
|
||||
// Update SwitchToTab command's icon
|
||||
SwitchToTabCommand().Icon(glyph);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Prepares this tab for being removed from the UI hierarchy
|
||||
void SettingsTab::Shutdown()
|
||||
{
|
||||
// TODO: Does/Will the settings UI need some shutdown procedures?
|
||||
Content(nullptr);
|
||||
_ClosedHandlers(nullptr, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a context menu attached to the tab.
|
||||
// Currently contains elements allowing the user to close the selected tab
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_CreateContextMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
// Close
|
||||
Controls::MenuFlyoutItem closeTabMenuItem;
|
||||
Controls::FontIcon closeSymbol;
|
||||
closeSymbol.FontFamily(Media::FontFamily{ L"Segoe MDL2 Assets" });
|
||||
closeSymbol.Glyph(L"\xE8BB");
|
||||
|
||||
closeTabMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_ClosedHandlers(nullptr, nullptr);
|
||||
}
|
||||
});
|
||||
closeTabMenuItem.Text(RS_(L"TabClose"));
|
||||
closeTabMenuItem.Icon(closeSymbol);
|
||||
|
||||
// Build the menu
|
||||
Controls::MenuFlyout newTabFlyout;
|
||||
newTabFlyout.Items().Append(_CreateCloseSubMenu());
|
||||
newTabFlyout.Items().Append(closeTabMenuItem);
|
||||
TabViewItem().ContextFlyout(newTabFlyout);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a sub-menu containing menu items to close multiple tabs
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the created MenuFlyoutSubItem
|
||||
Controls::MenuFlyoutSubItem SettingsTab::_CreateCloseSubMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
// Close tabs after
|
||||
_closeTabsAfterMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_CloseTabsAfter();
|
||||
}
|
||||
});
|
||||
_closeTabsAfterMenuItem.Text(RS_(L"TabCloseAfter"));
|
||||
|
||||
// Close other tabs
|
||||
_closeOtherTabsMenuItem.Click([weakThis](auto&&, auto&&) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_CloseOtherTabs();
|
||||
}
|
||||
});
|
||||
_closeOtherTabsMenuItem.Text(RS_(L"TabCloseOther"));
|
||||
|
||||
Controls::MenuFlyoutSubItem closeSubMenu;
|
||||
closeSubMenu.Text(RS_(L"TabCloseSubMenu"));
|
||||
closeSubMenu.Items().Append(_closeTabsAfterMenuItem);
|
||||
closeSubMenu.Items().Append(_closeOtherTabsMenuItem);
|
||||
|
||||
return closeSubMenu;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Enable the Close menu items based on tab index and total number of tabs
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void SettingsTab::_EnableCloseMenuItems()
|
||||
{
|
||||
// close other tabs is enabled only if there are other tabs
|
||||
_closeOtherTabsMenuItem.IsEnabled(TabViewNumTabs() > 1);
|
||||
// close tabs after is enabled only if there are other tabs on the right
|
||||
_closeTabsAfterMenuItem.IsEnabled(TabViewIndex() < TabViewNumTabs() - 1);
|
||||
}
|
||||
|
||||
void SettingsTab::_CloseTabsAfter()
|
||||
{
|
||||
CloseTabsAfterArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeTabsAfter{ ShortcutAction::CloseTabsAfter, args };
|
||||
|
||||
_dispatch.DoAction(closeTabsAfter);
|
||||
}
|
||||
|
||||
void SettingsTab::_CloseOtherTabs()
|
||||
{
|
||||
CloseOtherTabsArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeOtherTabs{ ShortcutAction::CloseOtherTabs, args };
|
||||
|
||||
_dispatch.DoAction(closeOtherTabs);
|
||||
}
|
||||
|
||||
void SettingsTab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- SettingsTab.h
|
||||
|
||||
Abstract:
|
||||
- The SettingsTab is a tab whose content is a Settings UI control. They can
|
||||
coexist in a TabView with all other types of tabs, like the TerminalTab.
|
||||
There should only be at most one SettingsTab open at any given time.
|
||||
|
||||
Author(s):
|
||||
- Leon Liang - October 2020
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include "SettingsTab.g.h"
|
||||
#include <winrt/TerminalApp.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Editor.h>
|
||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct SettingsTab : SettingsTabT<SettingsTab>
|
||||
{
|
||||
public:
|
||||
SettingsTab(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
|
||||
void Focus(winrt::Windows::UI::Xaml::FocusState focusState);
|
||||
winrt::Windows::UI::Xaml::FocusState FocusState() const noexcept;
|
||||
|
||||
void Shutdown();
|
||||
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
|
||||
GETSET_PROPERTY(winrt::hstring, Title);
|
||||
GETSET_PROPERTY(winrt::hstring, Icon);
|
||||
GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::Command, SwitchToTabCommand, nullptr);
|
||||
GETSET_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Xaml::Controls::Page, Content, nullptr);
|
||||
|
||||
// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
|
||||
// This is needed since Tab is going to be managing its own SwitchToTab command.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewIndex, _PropertyChangedHandlers, 0);
|
||||
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewNumTabs, _PropertyChangedHandlers, 0);
|
||||
|
||||
private:
|
||||
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
|
||||
|
||||
void _MakeTabViewItem();
|
||||
void _CreateContextMenu();
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutSubItem _CreateCloseSubMenu();
|
||||
void _EnableCloseMenuItems();
|
||||
winrt::fire_and_forget _CreateIcon();
|
||||
void _CloseTabsAfter();
|
||||
void _CloseOtherTabs();
|
||||
};
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "ITab.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
[default_interface] runtimeclass SettingsTab : ITab
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "pch.h"
|
||||
#include <LibraryResources.h>
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "TerminalTab.h"
|
||||
#include "TerminalTab.g.cpp"
|
||||
#include "Tab.h"
|
||||
#include "Tab.g.cpp"
|
||||
#include "Utils.h"
|
||||
#include "ColorHelper.h"
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace winrt
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
TerminalTab::TerminalTab(const GUID& profile, const TermControl& control)
|
||||
Tab::Tab(const GUID& profile, const TermControl& control)
|
||||
{
|
||||
_rootPane = std::make_shared<Pane>(profile, control, true);
|
||||
|
||||
@@ -33,10 +33,9 @@ namespace winrt::TerminalApp::implementation
|
||||
});
|
||||
|
||||
_activePane = _rootPane;
|
||||
Content(_rootPane->GetRootElement());
|
||||
|
||||
_MakeTabViewItem();
|
||||
_CreateContextMenu();
|
||||
_MakeSwitchToTabCommand();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -45,11 +44,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_MakeTabViewItem()
|
||||
void Tab::_MakeTabViewItem()
|
||||
{
|
||||
TabViewItem(::winrt::MUX::Controls::TabViewItem{});
|
||||
_tabViewItem = ::winrt::MUX::Controls::TabViewItem{};
|
||||
|
||||
TabViewItem().DoubleTapped([weakThis = get_weak()](auto&& /*s*/, auto&& /*e*/) {
|
||||
_tabViewItem.DoubleTapped([weakThis = get_weak()](auto&& /*s*/, auto&& /*e*/) {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
tab->_inRename = true;
|
||||
@@ -57,10 +56,28 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
|
||||
UpdateTitle();
|
||||
_UpdateTitle();
|
||||
_RecalculateAndApplyTabColor();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Get the root UIElement of this Tab's root pane.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The UIElement acting as root of the Tab's root pane.
|
||||
UIElement Tab::GetRootElement()
|
||||
{
|
||||
if (_zoomedPane)
|
||||
{
|
||||
return _zoomedPane->GetRootElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
return _rootPane->GetRootElement();
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns nullptr if no children of this tab were the last control to be
|
||||
// focused, or the TermControl that _was_ the last control to be focused (if
|
||||
@@ -72,55 +89,64 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - nullptr if no children were marked `_lastFocused`, else the TermControl
|
||||
// that was last focused.
|
||||
TermControl TerminalTab::GetActiveTerminalControl() const
|
||||
TermControl Tab::GetActiveTerminalControl() const
|
||||
{
|
||||
return _activePane->GetTerminalControl();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Gets the TabViewItem that represents this Tab
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The TabViewItem that represents this Tab
|
||||
winrt::MUX::Controls::TabViewItem Tab::GetTabViewItem()
|
||||
{
|
||||
return _tabViewItem;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Called after construction of a Tab object to bind event handlers to its
|
||||
// associated Pane and TermControl object
|
||||
// associated Pane and TermControl object and to create the context menu of
|
||||
// the tab item
|
||||
// Arguments:
|
||||
// - control: reference to the TermControl object to bind event to
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::Initialize(const TermControl& control)
|
||||
void Tab::Initialize(const TermControl& control)
|
||||
{
|
||||
_BindEventHandlers(control);
|
||||
_CreateContextMenu();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns the focus state of this Tab. Unfocused means this tab is not focused,
|
||||
// and any other FocusState means that this tab is focused. For any set of tabs,
|
||||
// - Returns true if this is the currently focused tab. For any set of tabs,
|
||||
// there should only be one tab that is marked as focused, though each tab has
|
||||
// no control over the other tabs in the set.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - A FocusState enum value
|
||||
WUX::FocusState TerminalTab::FocusState() const noexcept
|
||||
// - true iff this tab is focused.
|
||||
bool Tab::IsFocused() const noexcept
|
||||
{
|
||||
return _focusState;
|
||||
return _focused;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Updates our focus state. If we're gaining focus, make sure to transfer
|
||||
// focus to the last focused terminal control in our tree of controls.
|
||||
// Arguments:
|
||||
// - focused: our new focus state
|
||||
// - focused: our new focus state. If true, we should be focused. If false, we
|
||||
// should be unfocused.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::Focus(WUX::FocusState focusState)
|
||||
void Tab::SetFocused(const bool focused)
|
||||
{
|
||||
_focusState = focusState;
|
||||
_focused = focused;
|
||||
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
if (_focused)
|
||||
{
|
||||
auto lastFocusedControl = GetActiveTerminalControl();
|
||||
if (lastFocusedControl)
|
||||
{
|
||||
lastFocusedControl.Focus(_focusState);
|
||||
}
|
||||
_Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +159,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - nullopt if no children of this tab were the last control to be
|
||||
// focused, else the GUID of the profile of the last control to be focused
|
||||
std::optional<GUID> TerminalTab::GetFocusedProfile() const noexcept
|
||||
std::optional<GUID> Tab::GetFocusedProfile() const noexcept
|
||||
{
|
||||
return _activePane->GetFocusedProfile();
|
||||
}
|
||||
@@ -145,7 +171,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: reference to the TermControl object to bind event to
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_BindEventHandlers(const TermControl& control) noexcept
|
||||
void Tab::_BindEventHandlers(const TermControl& control) noexcept
|
||||
{
|
||||
_AttachEventHandlersToPane(_rootPane);
|
||||
_AttachEventHandlersToControl(control);
|
||||
@@ -158,18 +184,35 @@ namespace winrt::TerminalApp::implementation
|
||||
// - profile: The GUID of the profile these settings should apply to.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::UpdateSettings(const TerminalSettings& settings, const GUID& profile)
|
||||
void Tab::UpdateSettings(const TerminalSettings& settings, const GUID& profile)
|
||||
{
|
||||
_rootPane->UpdateSettings(settings, profile);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Focus the last focused control in our tree of panes.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_Focus()
|
||||
{
|
||||
_focused = true;
|
||||
|
||||
auto lastFocusedControl = GetActiveTerminalControl();
|
||||
if (lastFocusedControl)
|
||||
{
|
||||
lastFocusedControl.Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Set the icon on the TabViewItem for this tab.
|
||||
// Arguments:
|
||||
// - iconPath: The new path string to use as the IconPath for our TabViewItem
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TerminalTab::UpdateIcon(const winrt::hstring iconPath)
|
||||
winrt::fire_and_forget Tab::UpdateIcon(const winrt::hstring iconPath)
|
||||
{
|
||||
// Don't reload our icon if it hasn't changed.
|
||||
if (iconPath == _lastIconPath)
|
||||
@@ -181,13 +224,13 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
co_await winrt::resume_foreground(_tabViewItem.Dispatcher());
|
||||
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
// The TabViewItem Icon needs MUX while the IconSourceElement in the CommandPalette needs WUX...
|
||||
Icon(_lastIconPath);
|
||||
TabViewItem().IconSource(IconPathConverter::IconSourceMUX(_lastIconPath));
|
||||
IconSource(IconPathConverter::IconSourceWUX(_lastIconPath));
|
||||
_tabViewItem.IconSource(IconPathConverter::IconSourceMUX(_lastIconPath));
|
||||
|
||||
// Update SwitchToTab command's icon
|
||||
SwitchToTabCommand().Icon(_lastIconPath);
|
||||
@@ -201,7 +244,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the title string of the last focused terminal control in our tree.
|
||||
winrt::hstring TerminalTab::_GetActiveTitle() const
|
||||
winrt::hstring Tab::GetActiveTitle() const
|
||||
{
|
||||
if (!_runtimeTabText.empty())
|
||||
{
|
||||
@@ -219,14 +262,14 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TerminalTab::UpdateTitle()
|
||||
winrt::fire_and_forget Tab::_UpdateTitle()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
co_await winrt::resume_foreground(TabViewItem().Dispatcher());
|
||||
co_await winrt::resume_foreground(_tabViewItem.Dispatcher());
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
// Bubble our current tab text to anyone who's listening for changes.
|
||||
Title(_GetActiveTitle());
|
||||
Title(GetActiveTitle());
|
||||
|
||||
// Update SwitchToTab command's name
|
||||
SwitchToTabCommand().Name(Title());
|
||||
@@ -244,7 +287,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - delta: a number of lines to move the viewport relative to the current viewport.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TerminalTab::Scroll(const int delta)
|
||||
winrt::fire_and_forget Tab::Scroll(const int delta)
|
||||
{
|
||||
auto control = GetActiveTerminalControl();
|
||||
|
||||
@@ -260,7 +303,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - splitType: The type of split we want to create.
|
||||
// Return Value:
|
||||
// - True if the focused pane can be split. False otherwise.
|
||||
bool TerminalTab::CanSplitPane(SplitState splitType)
|
||||
bool Tab::CanSplitPane(SplitState splitType)
|
||||
{
|
||||
return _activePane->CanSplit(splitType);
|
||||
}
|
||||
@@ -274,7 +317,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: A TermControl to use in the new pane.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::SplitPane(SplitState splitType, const GUID& profile, TermControl& control)
|
||||
void Tab::SplitPane(SplitState splitType, const GUID& profile, TermControl& control)
|
||||
{
|
||||
auto [first, second] = _activePane->Split(splitType, profile, control);
|
||||
_activePane = first;
|
||||
@@ -294,7 +337,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - See Pane::CalcSnappedDimension
|
||||
float TerminalTab::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
|
||||
float Tab::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
|
||||
{
|
||||
return _rootPane->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
}
|
||||
@@ -306,7 +349,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - newSize: the amount of space that the panes have to fill now.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ResizeContent(const winrt::Windows::Foundation::Size& newSize)
|
||||
void Tab::ResizeContent(const winrt::Windows::Foundation::Size& newSize)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -320,7 +363,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - direction: The direction to move the separator in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ResizePane(const Direction& direction)
|
||||
void Tab::ResizePane(const Direction& direction)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -334,7 +377,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - direction: The direction to move the focus in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::NavigateFocus(const Direction& direction)
|
||||
void Tab::NavigateFocus(const Direction& direction)
|
||||
{
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
@@ -343,7 +386,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// Method Description:
|
||||
// - Prepares this tab for being removed from the UI hierarchy by shutting down all active connections.
|
||||
void TerminalTab::Shutdown()
|
||||
void Tab::Shutdown()
|
||||
{
|
||||
_rootPane->Shutdown();
|
||||
}
|
||||
@@ -356,21 +399,21 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ClosePane()
|
||||
void Tab::ClosePane()
|
||||
{
|
||||
_activePane->Close();
|
||||
}
|
||||
|
||||
void TerminalTab::SetTabText(winrt::hstring title)
|
||||
void Tab::SetTabText(winrt::hstring title)
|
||||
{
|
||||
_runtimeTabText = title;
|
||||
UpdateTitle();
|
||||
_UpdateTitle();
|
||||
}
|
||||
|
||||
void TerminalTab::ResetTabText()
|
||||
void Tab::ResetTabText()
|
||||
{
|
||||
_runtimeTabText = L"";
|
||||
UpdateTitle();
|
||||
_UpdateTitle();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -383,7 +426,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - control: the TermControl to add events to.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_AttachEventHandlersToControl(const TermControl& control)
|
||||
void Tab::_AttachEventHandlersToControl(const TermControl& control)
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -393,7 +436,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// The title of the control changed, but not necessarily the title of the tab.
|
||||
// Set the tab's text to the active panes' text.
|
||||
tab->UpdateTitle();
|
||||
tab->_UpdateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -430,7 +473,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - pane: a Pane to mark as active.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_UpdateActivePane(std::shared_ptr<Pane> pane)
|
||||
void Tab::_UpdateActivePane(std::shared_ptr<Pane> pane)
|
||||
{
|
||||
// Clear the active state of the entire tree, and mark only the pane as active.
|
||||
_rootPane->ClearActive();
|
||||
@@ -438,7 +481,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_activePane->SetActive();
|
||||
|
||||
// Update our own title text to match the newly-active pane.
|
||||
UpdateTitle();
|
||||
_UpdateTitle();
|
||||
|
||||
// Raise our own ActivePaneChanged event.
|
||||
_ActivePaneChangedHandlers();
|
||||
@@ -453,7 +496,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_AttachEventHandlersToPane(std::shared_ptr<Pane> pane)
|
||||
void Tab::_AttachEventHandlersToPane(std::shared_ptr<Pane> pane)
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -467,22 +510,6 @@ namespace winrt::TerminalApp::implementation
|
||||
tab->_RecalculateAndApplyTabColor();
|
||||
}
|
||||
});
|
||||
|
||||
// Add a Closed event handler to the Pane. If the pane closes out from
|
||||
// underneath us, and it's zoomed, we want to be able to make sure to
|
||||
// update our state accordingly to un-zoom that pane. See GH#7252.
|
||||
pane->Closed([weakThis](auto&& /*s*/, auto && /*e*/) -> winrt::fire_and_forget {
|
||||
if (auto tab{ weakThis.get() })
|
||||
{
|
||||
if (tab->_zoomedPane)
|
||||
{
|
||||
co_await winrt::resume_foreground(tab->Content().Dispatcher());
|
||||
|
||||
tab->Content(tab->_rootPane->GetRootElement());
|
||||
tab->ExitZoom();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -493,7 +520,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_CreateContextMenu()
|
||||
void Tab::_CreateContextMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -568,7 +595,7 @@ namespace winrt::TerminalApp::implementation
|
||||
newTabFlyout.Items().Append(menuSeparator);
|
||||
newTabFlyout.Items().Append(_CreateCloseSubMenu());
|
||||
newTabFlyout.Items().Append(closeTabMenuItem);
|
||||
TabViewItem().ContextFlyout(newTabFlyout);
|
||||
_tabViewItem.ContextFlyout(newTabFlyout);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -577,7 +604,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - the created MenuFlyoutSubItem
|
||||
Controls::MenuFlyoutSubItem TerminalTab::_CreateCloseSubMenu()
|
||||
Controls::MenuFlyoutSubItem Tab::_CreateCloseSubMenu()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
@@ -613,7 +640,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_EnableCloseMenuItems()
|
||||
void Tab::_EnableCloseMenuItems()
|
||||
{
|
||||
// close other tabs is enabled only if there are other tabs
|
||||
_closeOtherTabsMenuItem.IsEnabled(TabViewNumTabs() > 1);
|
||||
@@ -633,9 +660,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_UpdateTabHeader()
|
||||
void Tab::_UpdateTabHeader()
|
||||
{
|
||||
winrt::hstring tabText{ Title() };
|
||||
winrt::hstring tabText{ GetActiveTitle() };
|
||||
|
||||
if (!_inRename)
|
||||
{
|
||||
@@ -653,13 +680,13 @@ namespace winrt::TerminalApp::implementation
|
||||
tb.Text(tabText);
|
||||
sp.Children().Append(tb);
|
||||
|
||||
TabViewItem().Header(sp);
|
||||
_tabViewItem.Header(sp);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we're not currently in the process of renaming the tab,
|
||||
// then just set the tab's text to whatever our active title is.
|
||||
TabViewItem().Header(winrt::box_value(tabText));
|
||||
_tabViewItem.Header(winrt::box_value(tabText));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -676,9 +703,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tabText: This should be the text to initialize the rename text box with.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_ConstructTabRenameBox(const winrt::hstring& tabText)
|
||||
void Tab::_ConstructTabRenameBox(const winrt::hstring& tabText)
|
||||
{
|
||||
if (TabViewItem().Header().try_as<Controls::TextBox>())
|
||||
if (_tabViewItem.Header().try_as<Controls::TextBox>())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -726,7 +753,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
tab->_runtimeTabText = textBox.Text();
|
||||
tab->_inRename = false;
|
||||
tab->UpdateTitle();
|
||||
tab->_UpdateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -748,7 +775,7 @@ namespace winrt::TerminalApp::implementation
|
||||
e.Handled(true);
|
||||
textBox.Text(tab->_runtimeTabText);
|
||||
tab->_inRename = false;
|
||||
tab->UpdateTitle();
|
||||
tab->_UpdateTitle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -758,7 +785,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_tabRenameBoxLayoutUpdatedRevoker = tabTextBox.LayoutUpdated(winrt::auto_revoke, [this](auto&&, auto&&) {
|
||||
// Curiously, the sender for this event is null, so we have to
|
||||
// get the TextBox from the Tab's Header().
|
||||
auto textBox{ TabViewItem().Header().try_as<Controls::TextBox>() };
|
||||
auto textBox{ _tabViewItem.Header().try_as<Controls::TextBox>() };
|
||||
if (textBox)
|
||||
{
|
||||
textBox.SelectAll();
|
||||
@@ -768,7 +795,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_tabRenameBoxLayoutUpdatedRevoker.revoke();
|
||||
});
|
||||
|
||||
TabViewItem().Header(tabTextBox);
|
||||
_tabViewItem.Header(tabTextBox);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -777,7 +804,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The tab's color, if any
|
||||
std::optional<winrt::Windows::UI::Color> TerminalTab::GetTabColor()
|
||||
std::optional<winrt::Windows::UI::Color> Tab::GetTabColor()
|
||||
{
|
||||
const auto currControlColor{ GetActiveTerminalControl().TabColor() };
|
||||
std::optional<winrt::Windows::UI::Color> controlTabColor;
|
||||
@@ -814,7 +841,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - color: the color the user picked for their tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::SetRuntimeTabColor(const winrt::Windows::UI::Color& color)
|
||||
void Tab::SetRuntimeTabColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
_runtimeTabColor.emplace(color);
|
||||
_RecalculateAndApplyTabColor();
|
||||
@@ -829,11 +856,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_RecalculateAndApplyTabColor()
|
||||
void Tab::_RecalculateAndApplyTabColor()
|
||||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis]() {
|
||||
_tabViewItem.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [weakThis]() {
|
||||
auto ptrTab = weakThis.get();
|
||||
if (!ptrTab)
|
||||
return;
|
||||
@@ -861,7 +888,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - color: the color the user picked for their tab
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_ApplyTabColor(const winrt::Windows::UI::Color& color)
|
||||
void Tab::_ApplyTabColor(const winrt::Windows::UI::Color& color)
|
||||
{
|
||||
Media::SolidColorBrush selectedTabBrush{};
|
||||
Media::SolidColorBrush deselectedTabBrush{};
|
||||
@@ -890,15 +917,15 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// currently if a tab has a custom color, a deselected state is
|
||||
// signified by using the same color with a bit ot transparency
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush);
|
||||
_tabViewItem.Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush);
|
||||
|
||||
_RefreshVisualState();
|
||||
|
||||
@@ -913,7 +940,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ResetRuntimeTabColor()
|
||||
void Tab::ResetRuntimeTabColor()
|
||||
{
|
||||
_runtimeTabColor.reset();
|
||||
_RecalculateAndApplyTabColor();
|
||||
@@ -926,7 +953,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_ClearTabBackgroundColor()
|
||||
void Tab::_ClearTabBackgroundColor()
|
||||
{
|
||||
winrt::hstring keys[] = {
|
||||
L"TabViewItemHeaderBackground",
|
||||
@@ -944,9 +971,9 @@ namespace winrt::TerminalApp::implementation
|
||||
for (auto keyString : keys)
|
||||
{
|
||||
auto key = winrt::box_value(keyString);
|
||||
if (TabViewItem().Resources().HasKey(key))
|
||||
if (_tabViewItem.Resources().HasKey(key))
|
||||
{
|
||||
TabViewItem().Resources().Remove(key);
|
||||
_tabViewItem.Resources().Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -960,9 +987,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ActivateColorPicker()
|
||||
void Tab::ActivateColorPicker()
|
||||
{
|
||||
_tabColorPickup.ShowAt(TabViewItem());
|
||||
_tabColorPickup.ShowAt(_tabViewItem);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -972,17 +999,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::_RefreshVisualState()
|
||||
void Tab::_RefreshVisualState()
|
||||
{
|
||||
if (_focusState != FocusState::Unfocused)
|
||||
if (_focused)
|
||||
{
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
||||
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Selected", true);
|
||||
VisualStateManager::GoToState(_tabViewItem, L"Normal", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -992,7 +1019,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The total number of leaf panes hosted by this tab.
|
||||
int TerminalTab::GetLeafPaneCount() const noexcept
|
||||
int Tab::GetLeafPaneCount() const noexcept
|
||||
{
|
||||
return _rootPane->GetLeafPaneCount();
|
||||
}
|
||||
@@ -1007,12 +1034,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - The SplitState that we should use for an `Automatic` split given
|
||||
// `availableSpace`
|
||||
SplitState TerminalTab::PreCalculateAutoSplit(winrt::Windows::Foundation::Size availableSpace) const
|
||||
SplitState Tab::PreCalculateAutoSplit(winrt::Windows::Foundation::Size availableSpace) const
|
||||
{
|
||||
return _rootPane->PreCalculateAutoSplit(_activePane, availableSpace).value_or(SplitState::Vertical);
|
||||
}
|
||||
|
||||
bool TerminalTab::PreCalculateCanSplit(SplitState splitType, winrt::Windows::Foundation::Size availableSpace) const
|
||||
bool Tab::PreCalculateCanSplit(SplitState splitType, winrt::Windows::Foundation::Size availableSpace) const
|
||||
{
|
||||
return _rootPane->PreCalculateCanSplit(_activePane, splitType, availableSpace).value_or(false);
|
||||
}
|
||||
@@ -1021,13 +1048,13 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Toggle our zoom state.
|
||||
// * If we're not zoomed, then zoom the active pane, making it take the
|
||||
// full size of the tab. We'll achieve this by changing our response to
|
||||
// Tab::GetTabContent, so that it'll return the zoomed pane only.
|
||||
// Tab::GetRootElement, so that it'll return the zoomed pane only.
|
||||
// * If we're currently zoomed on a pane, un-zoom that pane.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalTab::ToggleZoom()
|
||||
void Tab::ToggleZoom()
|
||||
{
|
||||
if (_zoomedPane)
|
||||
{
|
||||
@@ -1038,29 +1065,46 @@ namespace winrt::TerminalApp::implementation
|
||||
EnterZoom();
|
||||
}
|
||||
}
|
||||
void TerminalTab::EnterZoom()
|
||||
void Tab::EnterZoom()
|
||||
{
|
||||
_zoomedPane = _activePane;
|
||||
_rootPane->Maximize(_zoomedPane);
|
||||
// Update the tab header to show the magnifying glass
|
||||
_UpdateTabHeader();
|
||||
Content(_zoomedPane->GetRootElement());
|
||||
}
|
||||
void TerminalTab::ExitZoom()
|
||||
void Tab::ExitZoom()
|
||||
{
|
||||
_rootPane->Restore(_zoomedPane);
|
||||
_zoomedPane = nullptr;
|
||||
// Update the tab header to hide the magnifying glass
|
||||
_UpdateTabHeader();
|
||||
Content(_rootPane->GetRootElement());
|
||||
}
|
||||
|
||||
bool TerminalTab::IsZoomed()
|
||||
bool Tab::IsZoomed()
|
||||
{
|
||||
return _zoomedPane != nullptr;
|
||||
}
|
||||
|
||||
void TerminalTab::_CloseTabsAfter()
|
||||
// Method Description:
|
||||
// - Initializes a SwitchToTab command object for this Tab instance.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::_MakeSwitchToTabCommand()
|
||||
{
|
||||
SwitchToTabArgs args{ _TabViewIndex };
|
||||
ActionAndArgs focusTabAction{ ShortcutAction::SwitchToTab, args };
|
||||
|
||||
Command command;
|
||||
command.Action(focusTabAction);
|
||||
command.Name(Title());
|
||||
command.Icon(_lastIconPath);
|
||||
|
||||
SwitchToTabCommand(command);
|
||||
}
|
||||
|
||||
void Tab::_CloseTabsAfter()
|
||||
{
|
||||
CloseTabsAfterArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeTabsAfter{ ShortcutAction::CloseTabsAfter, args };
|
||||
@@ -1068,7 +1112,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_dispatch.DoAction(closeTabsAfter);
|
||||
}
|
||||
|
||||
void TerminalTab::_CloseOtherTabs()
|
||||
void Tab::_CloseOtherTabs()
|
||||
{
|
||||
CloseOtherTabsArgs args{ _TabViewIndex };
|
||||
ActionAndArgs closeOtherTabs{ ShortcutAction::CloseOtherTabs, args };
|
||||
@@ -1076,12 +1120,20 @@ namespace winrt::TerminalApp::implementation
|
||||
_dispatch.DoAction(closeOtherTabs);
|
||||
}
|
||||
|
||||
void TerminalTab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
void Tab::UpdateTabViewIndex(const uint32_t idx, const uint32_t numTabs)
|
||||
{
|
||||
TabViewIndex(idx);
|
||||
TabViewNumTabs(numTabs);
|
||||
_EnableCloseMenuItems();
|
||||
SwitchToTabCommand().Action().Args().as<SwitchToTabArgs>().TabIndex(idx);
|
||||
}
|
||||
|
||||
void Tab::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
|
||||
DEFINE_EVENT(TerminalTab, ActivePaneChanged, _ActivePaneChangedHandlers, winrt::delegate<>);
|
||||
DEFINE_EVENT(TerminalTab, ColorSelected, _colorSelected, winrt::delegate<winrt::Windows::UI::Color>);
|
||||
DEFINE_EVENT(TerminalTab, ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
DEFINE_EVENT(Tab, ActivePaneChanged, _ActivePaneChangedHandlers, winrt::delegate<>);
|
||||
DEFINE_EVENT(Tab, ColorSelected, _colorSelected, winrt::delegate<winrt::Windows::UI::Color>);
|
||||
DEFINE_EVENT(Tab, ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
#include "Pane.h"
|
||||
#include "ColorPickupFlyout.h"
|
||||
#include "TerminalTab.g.h"
|
||||
#include "Tab.g.h"
|
||||
|
||||
// fwdecl unittest classes
|
||||
namespace TerminalAppLocalTests
|
||||
@@ -14,19 +14,22 @@ namespace TerminalAppLocalTests
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct TerminalTab : TerminalTabT<TerminalTab>
|
||||
struct Tab : public TabT<Tab>
|
||||
{
|
||||
public:
|
||||
TerminalTab(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
Tab() = delete;
|
||||
Tab(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
|
||||
// Called after construction to perform the necessary setup, which relies on weak_ptr
|
||||
void Initialize(const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
|
||||
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem GetTabViewItem();
|
||||
winrt::Windows::UI::Xaml::UIElement GetRootElement();
|
||||
winrt::Microsoft::Terminal::TerminalControl::TermControl GetActiveTerminalControl() const;
|
||||
std::optional<GUID> GetFocusedProfile() const noexcept;
|
||||
|
||||
void Focus(winrt::Windows::UI::Xaml::FocusState focusState);
|
||||
winrt::Windows::UI::Xaml::FocusState FocusState() const noexcept;
|
||||
bool IsFocused() const noexcept;
|
||||
void SetFocused(const bool focused);
|
||||
|
||||
winrt::fire_and_forget Scroll(const int delta);
|
||||
|
||||
@@ -44,7 +47,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void NavigateFocus(const winrt::Microsoft::Terminal::Settings::Model::Direction& direction);
|
||||
|
||||
void UpdateSettings(const winrt::TerminalApp::TerminalSettings& settings, const GUID& profile);
|
||||
winrt::fire_and_forget UpdateTitle();
|
||||
winrt::hstring GetActiveTitle() const;
|
||||
|
||||
void Shutdown();
|
||||
void ClosePane();
|
||||
@@ -65,6 +68,8 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
int GetLeafPaneCount() const noexcept;
|
||||
|
||||
void UpdateTabViewIndex(const uint32_t idx, const uint32_t numTabs);
|
||||
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
@@ -74,18 +79,15 @@ namespace winrt::TerminalApp::implementation
|
||||
DECLARE_EVENT(ColorCleared, _colorCleared, winrt::delegate<>);
|
||||
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::Controls::IconSource, IconSource, _PropertyChangedHandlers, nullptr);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::Command, SwitchToTabCommand, _PropertyChangedHandlers, nullptr);
|
||||
|
||||
GETSET_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);
|
||||
// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
|
||||
// This is needed since Tab is going to be managing its own SwitchToTab command.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewIndex, _PropertyChangedHandlers, 0);
|
||||
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector.
|
||||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewNumTabs, _PropertyChangedHandlers, 0);
|
||||
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::FrameworkElement, Content, _PropertyChangedHandlers, nullptr);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Pane> _rootPane{ nullptr };
|
||||
std::shared_ptr<Pane> _activePane{ nullptr };
|
||||
@@ -97,7 +99,8 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
|
||||
|
||||
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
|
||||
bool _focused{ false };
|
||||
winrt::Microsoft::UI::Xaml::Controls::TabViewItem _tabViewItem{ nullptr };
|
||||
|
||||
winrt::hstring _runtimeTabText{};
|
||||
bool _inRename{ false };
|
||||
@@ -106,6 +109,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
|
||||
|
||||
void _MakeTabViewItem();
|
||||
void _Focus();
|
||||
|
||||
void _CreateContextMenu();
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutSubItem _CreateCloseSubMenu();
|
||||
@@ -120,14 +124,16 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _UpdateActivePane(std::shared_ptr<Pane> pane);
|
||||
|
||||
winrt::hstring _GetActiveTitle() const;
|
||||
void _UpdateTabHeader();
|
||||
winrt::fire_and_forget _UpdateTitle();
|
||||
void _ConstructTabRenameBox(const winrt::hstring& tabText);
|
||||
|
||||
void _RecalculateAndApplyTabColor();
|
||||
void _ApplyTabColor(const winrt::Windows::UI::Color& color);
|
||||
void _ClearTabBackgroundColor();
|
||||
|
||||
void _MakeSwitchToTabCommand();
|
||||
|
||||
void _CloseTabsAfter();
|
||||
void _CloseOtherTabs();
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TerminalApp
|
||||
Microsoft.Terminal.Settings.Model.Command SwitchToTabCommand { get; };
|
||||
UInt32 TabViewIndex { get; };
|
||||
|
||||
Windows.UI.Xaml.FrameworkElement Content { get; };
|
||||
|
||||
void SetDispatch(ShortcutActionDispatch dispatch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,12 +76,6 @@
|
||||
<ClInclude Include="MinMaxCloseControl.h">
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SettingsTab.h">
|
||||
<DependentUpon>SettingsTab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TerminalTab.h">
|
||||
<DependentUpon>TerminalTab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TerminalPage.h">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -107,6 +101,9 @@
|
||||
<ClInclude Include="IconPathConverter.h">
|
||||
<DependentUpon>IconPathConverter.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Tab.h">
|
||||
<DependentUpon>Tab.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Pane.h" />
|
||||
<ClInclude Include="ColorHelper.h" />
|
||||
<ClInclude Include="TerminalSettings.h">
|
||||
@@ -136,12 +133,6 @@
|
||||
<ClCompile Include="MinMaxCloseControl.cpp">
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SettingsTab.cpp">
|
||||
<DependentUpon>SettingsTab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalTab.cpp">
|
||||
<DependentUpon>TerminalTab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalPage.cpp">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -167,6 +158,9 @@
|
||||
<ClCompile Include="IconPathConverter.cpp">
|
||||
<DependentUpon>IconPathConverter.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Tab.cpp">
|
||||
<DependentUpon>Tab.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Pane.cpp" />
|
||||
<ClCompile Include="Pane.LayoutSizeNode.cpp" />
|
||||
<ClCompile Include="ColorHelper.cpp" />
|
||||
@@ -202,7 +196,6 @@
|
||||
<Midl Include="App.idl">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="SettingsTab.idl" />
|
||||
<Midl Include="ShortcutActionDispatch.idl" />
|
||||
<Midl Include="AppKeyBindings.idl" />
|
||||
<Midl Include="AppLogic.idl" />
|
||||
@@ -210,8 +203,6 @@
|
||||
<DependentUpon>MinMaxCloseControl.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="ITab.idl" />
|
||||
<Midl Include="TerminalTab.idl" />
|
||||
<Midl Include="TerminalPage.idl">
|
||||
<DependentUpon>TerminalPage.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -235,6 +226,7 @@
|
||||
<Midl Include="EmptyStringVisibilityConverter.idl" />
|
||||
<Midl Include="HasNestedCommandsVisibilityConverter.idl" />
|
||||
<Midl Include="IconPathConverter.idl" />
|
||||
<Midl Include="Tab.idl" />
|
||||
<Midl Include="TerminalSettings.idl" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
@@ -287,12 +279,6 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Editor">
|
||||
<HintPath>$(_BinRoot)Microsoft.Terminal.Settings.Editor\Microsoft.Terminal.Settings.Editor.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Model">
|
||||
<HintPath>$(_BinRoot)Microsoft.Terminal.Settings.Model\Microsoft.Terminal.Settings.Model.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
|
||||
@@ -27,13 +27,6 @@
|
||||
<ClCompile Include="TerminalSettings.cpp">
|
||||
<Filter>settings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Jumplist.cpp" />
|
||||
<ClCompile Include="Tab.cpp">
|
||||
<Filter>tab</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SettingsTab.cpp">
|
||||
<Filter>tab</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Utils.h" />
|
||||
@@ -55,13 +48,6 @@
|
||||
<ClInclude Include="TerminalSettings.h">
|
||||
<Filter>settings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Jumplist.h" />
|
||||
<ClInclude Include="Tab.h">
|
||||
<Filter>tab</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SettingsTab.h">
|
||||
<Filter>tab</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="AppLogic.idl">
|
||||
@@ -76,19 +62,14 @@
|
||||
<Midl Include="ShortcutActionDispatch.idl">
|
||||
<Filter>settings</Filter>
|
||||
</Midl>
|
||||
<Midl Include="Tab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="IDirectKeyListener.idl" />
|
||||
<Midl Include="CommandKeyChordVisibilityConverter.idl" />
|
||||
<Midl Include="TerminalSettings.idl">
|
||||
<Filter>settings</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ITab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="SettingsTab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
<Midl Include="TerminalTab.idl">
|
||||
<Filter>tab</Filter>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
@@ -138,4 +119,4 @@
|
||||
<Filter>app</Filter>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "TabRowControl.h"
|
||||
#include "ColorHelper.h"
|
||||
#include "DebugTapConnection.h"
|
||||
#include "SettingsTab.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
@@ -43,8 +42,7 @@ namespace winrt
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
TerminalPage::TerminalPage() :
|
||||
_tabs{ winrt::single_threaded_observable_vector<TerminalApp::ITab>() },
|
||||
_mruTabActions{ winrt::single_threaded_vector<Command>() },
|
||||
_tabs{ winrt::single_threaded_observable_vector<TerminalApp::Tab>() },
|
||||
_startupActions{ winrt::single_threaded_vector<ActionAndArgs>() }
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -225,6 +223,13 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
|
||||
_tabs.VectorChanged([weakThis{ get_weak() }](auto&& s, auto&& e) {
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
page->CommandPalette().OnTabsChanged(s, e);
|
||||
}
|
||||
});
|
||||
|
||||
// Settings AllowDependentAnimations will affect whether animations are
|
||||
// enabled application-wide, so we don't need to check it each time we
|
||||
// want to create an animation.
|
||||
@@ -663,12 +668,9 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
TermControl term{ settings, connection };
|
||||
|
||||
auto newTabImpl = winrt::make_self<TerminalTab>(profileGuid, term);
|
||||
_MakeSwitchToTabCommand(*newTabImpl, _tabs.Size());
|
||||
|
||||
// Add the new tab to the list of our tabs.
|
||||
auto newTabImpl = winrt::make_self<Tab>(profileGuid, term);
|
||||
_tabs.Append(*newTabImpl);
|
||||
_mruTabActions.Append(newTabImpl->SwitchToTabCommand());
|
||||
|
||||
newTabImpl->SetDispatch(*_actionDispatch);
|
||||
|
||||
@@ -683,8 +685,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto weakTab = make_weak(newTabImpl);
|
||||
|
||||
// When the tab's active pane changes, we'll want to lookup a new icon
|
||||
// for it. The Title change will be propagated upwards through the tab's
|
||||
// PropertyChanged event handler.
|
||||
// for it, and possibly propagate the title up to the window.
|
||||
newTabImpl->ActivePaneChanged([weakTab, weakThis{ get_weak() }]() {
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
@@ -693,12 +694,24 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Possibly update the icon of the tab.
|
||||
page->_UpdateTabIcon(*tab);
|
||||
// Possibly update the title of the tab, window to match the newly
|
||||
// focused pane.
|
||||
page->_UpdateTitle(*tab);
|
||||
}
|
||||
});
|
||||
|
||||
auto tabViewItem = newTabImpl->TabViewItem();
|
||||
auto tabViewItem = newTabImpl->GetTabViewItem();
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
_ReapplyCompactTabSize();
|
||||
// GH#6570
|
||||
// The TabView does not apply compact sizing to items added after Compact is enabled.
|
||||
// By forcibly reapplying compact sizing every time we add a new tab, we'll make sure
|
||||
// that it works.
|
||||
// Workaround from https://github.com/microsoft/microsoft-ui-xaml/issues/2711
|
||||
if (_tabView.TabWidthMode() == MUX::Controls::TabViewWidthMode::Compact)
|
||||
{
|
||||
_tabView.UpdateLayout();
|
||||
_tabView.TabWidthMode(MUX::Controls::TabViewWidthMode::Compact);
|
||||
}
|
||||
|
||||
// Set this tab's icon to the icon from the user's profile
|
||||
const auto profile = _settings.FindProfile(profileGuid);
|
||||
@@ -915,12 +928,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// TitleChanged event.
|
||||
// Arguments:
|
||||
// - tab: the Tab to update the title for.
|
||||
void TerminalPage::_UpdateTitle(const TerminalTab& tab)
|
||||
void TerminalPage::_UpdateTitle(const Tab& tab)
|
||||
{
|
||||
auto newTabTitle = tab.Title();
|
||||
auto newTabTitle = tab.GetActiveTitle();
|
||||
|
||||
if (_settings.GlobalSettings().ShowTitleInTitlebar() &&
|
||||
tab.FocusState() != FocusState::Unfocused)
|
||||
tab.IsFocused())
|
||||
{
|
||||
_titleChangeHandlers(*this, newTabTitle);
|
||||
}
|
||||
@@ -931,7 +944,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// tab's icon to that icon.
|
||||
// Arguments:
|
||||
// - tab: the Tab to update the title for.
|
||||
void TerminalPage::_UpdateTabIcon(TerminalTab& tab)
|
||||
void TerminalPage::_UpdateTabIcon(Tab& tab)
|
||||
{
|
||||
const auto lastFocusedProfileOpt = tab.GetFocusedProfile();
|
||||
if (lastFocusedProfileOpt.has_value())
|
||||
@@ -982,32 +995,30 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO: GH#5047 - In the future, we should get the Profile of
|
||||
// the focused pane, and use that to build a new instance of the
|
||||
// settings so we can duplicate this tab/pane.
|
||||
//
|
||||
// Currently, if the profile doesn't exist anymore in our
|
||||
// settings, we'll silently do nothing.
|
||||
//
|
||||
// In the future, it will be preferable to just duplicate the
|
||||
// current control's settings, but we can't do that currently,
|
||||
// because we won't be able to create a new instance of the
|
||||
// connection without keeping an instance of the original Profile
|
||||
// object around.
|
||||
auto focusedTab = _GetStrongTabImpl(*index);
|
||||
// TODO: GH#5047 - In the future, we should get the Profile of
|
||||
// the focused pane, and use that to build a new instance of the
|
||||
// settings so we can duplicate this tab/pane.
|
||||
//
|
||||
// Currently, if the profile doesn't exist anymore in our
|
||||
// settings, we'll silently do nothing.
|
||||
//
|
||||
// In the future, it will be preferable to just duplicate the
|
||||
// current control's settings, but we can't do that currently,
|
||||
// because we won't be able to create a new instance of the
|
||||
// connection without keeping an instance of the original Profile
|
||||
// object around.
|
||||
|
||||
const auto& profileGuid = terminalTab->GetFocusedProfile();
|
||||
if (profileGuid.has_value())
|
||||
{
|
||||
const auto settings{ winrt::make<TerminalSettings>(_settings, profileGuid.value(), *_bindings) };
|
||||
_CreateNewTabFromSettings(profileGuid.value(), settings);
|
||||
}
|
||||
const auto& profileGuid = focusedTab->GetFocusedProfile();
|
||||
if (profileGuid.has_value())
|
||||
{
|
||||
const auto settings{ winrt::make<TerminalSettings>(_settings, profileGuid.value(), *_bindings) };
|
||||
_CreateNewTabFromSettings(profileGuid.value(), settings);
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,15 +1045,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Removing the tab from the collection should destroy its control and disconnect its connection,
|
||||
// but it doesn't always do so. The UI tree may still be holding the control and preventing its destruction.
|
||||
auto tab{ _tabs.GetAt(tabIndex) };
|
||||
tab.Shutdown();
|
||||
|
||||
uint32_t mruIndex;
|
||||
if (_mruTabActions.IndexOf(_tabs.GetAt(tabIndex).SwitchToTabCommand(), mruIndex))
|
||||
{
|
||||
_mruTabActions.RemoveAt(mruIndex);
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
}
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
tab->Shutdown();
|
||||
|
||||
_tabs.RemoveAt(tabIndex);
|
||||
_tabView.TabItems().RemoveAt(tabIndex);
|
||||
@@ -1085,8 +1089,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// here. If we don't, then the TabView will technically not have a
|
||||
// selected item at all, which can make things like ClosePane not
|
||||
// work correctly.
|
||||
auto newSelectedTab{ _tabs.GetAt(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab.TabViewItem());
|
||||
auto newSelectedTab{ _GetStrongTabImpl(newSelectedIndex) };
|
||||
_tabView.SelectedItem(newSelectedTab->GetTabViewItem());
|
||||
}
|
||||
|
||||
// GH#5559 - If we were in the middle of a drag/drop, end it by clearing
|
||||
@@ -1108,7 +1112,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Arguments:
|
||||
// - term: The newly created TermControl to connect the events for
|
||||
// - hostingTab: The Tab that's hosting this TermControl instance
|
||||
void TerminalPage::_RegisterTerminalEvents(TermControl term, TerminalTab& hostingTab)
|
||||
void TerminalPage::_RegisterTerminalEvents(TermControl term, Tab& hostingTab)
|
||||
{
|
||||
// Add an event handler when the terminal's selection wants to be copied.
|
||||
// When the text buffer data is retrieved, we'll copy the data into the Clipboard
|
||||
@@ -1136,16 +1140,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
page->_UpdateTitle(*tab);
|
||||
}
|
||||
else if (args.PropertyName() == L"Content")
|
||||
{
|
||||
if (*tab == page->_GetFocusedTab())
|
||||
{
|
||||
page->_tabContent.Children().Clear();
|
||||
page->_tabContent.Children().Append(tab->Content());
|
||||
|
||||
tab->Focus(FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1154,7 +1148,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && (tab->FocusState() != FocusState::Unfocused))
|
||||
if (page && tab && tab->IsFocused())
|
||||
{
|
||||
page->_SetNonClientAreaColors(color);
|
||||
}
|
||||
@@ -1164,7 +1158,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto page{ weakThis.get() };
|
||||
auto tab{ weakTab.get() };
|
||||
|
||||
if (page && tab && (tab->FocusState() != FocusState::Unfocused))
|
||||
if (page && tab && tab->IsFocused())
|
||||
{
|
||||
page->_ClearNonClientAreaColors();
|
||||
}
|
||||
@@ -1182,33 +1176,28 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Sets focus to the tab to the right or left the currently selected tab.
|
||||
void TerminalPage::_SelectNextTab(const bool bMoveRight)
|
||||
{
|
||||
if (_settings.GlobalSettings().UseTabSwitcher())
|
||||
{
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
|
||||
// Since ATS is always MRU, our focused tab index is always 0.
|
||||
// So, going next should go to index 1, and going prev should wrap to the end.
|
||||
uint32_t tabCount = _mruTabActions.Size();
|
||||
auto newTabIndex = ((tabCount + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
|
||||
if (CommandPalette().Visibility() == Visibility::Visible)
|
||||
{
|
||||
CommandPalette().SelectNextItem(bMoveRight);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommandPalette().EnableTabSwitcherMode(false, newTabIndex);
|
||||
CommandPalette().Visibility(Visibility::Visible);
|
||||
}
|
||||
}
|
||||
else if (auto index{ _GetFocusedTabIndex() })
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
uint32_t tabCount = _tabs.Size();
|
||||
// Wraparound math. By adding tabCount and then calculating modulo tabCount,
|
||||
// we clamp the values to the range [0, tabCount) while still supporting moving
|
||||
// leftward from 0 to tabCount - 1.
|
||||
auto newTabIndex = ((tabCount + *index + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
_SelectTab(newTabIndex);
|
||||
const auto newTabIndex = ((tabCount + *index + (bMoveRight ? 1 : -1)) % tabCount);
|
||||
|
||||
if (_settings.GlobalSettings().UseTabSwitcher())
|
||||
{
|
||||
if (CommandPalette().Visibility() == Visibility::Visible)
|
||||
{
|
||||
CommandPalette().SelectNextItem(bMoveRight);
|
||||
}
|
||||
|
||||
CommandPalette().EnableTabSwitcherMode(false, newTabIndex);
|
||||
CommandPalette().Visibility(Visibility::Visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
_SelectTab(newTabIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1228,8 +1217,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (_startupState == StartupState::InStartup)
|
||||
{
|
||||
auto tab{ _tabs.GetAt(tabIndex) };
|
||||
_tabView.SelectedItem(tab.TabViewItem());
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
_UpdatedSelectedTab(tabIndex);
|
||||
}
|
||||
else
|
||||
@@ -1257,21 +1246,15 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
void TerminalPage::_UnZoomIfNeeded()
|
||||
{
|
||||
if (auto focusedTab = _GetFocusedTab())
|
||||
auto activeTab = _GetFocusedTab();
|
||||
if (activeTab && activeTab->IsZoomed())
|
||||
{
|
||||
if (auto activeTab = _GetTerminalTabImpl(focusedTab))
|
||||
{
|
||||
if (activeTab->IsZoomed())
|
||||
{
|
||||
// Remove the content from the tab first, so Pane::UnZoom can
|
||||
// re-attach the content to the tree w/in the pane
|
||||
_tabContent.Children().Clear();
|
||||
// In ExitZoom, we'll change the Tab's Content(), triggering the
|
||||
// content changed event, which will re-attach the tab's new content
|
||||
// root to the tree.
|
||||
activeTab->ExitZoom();
|
||||
}
|
||||
}
|
||||
// Remove the content from the tab first, so Pane::UnZoom can
|
||||
// re-attach the content to the tree w/in the pane
|
||||
_tabContent.Children().Clear();
|
||||
activeTab->ExitZoom();
|
||||
// Re-attach the tab's content to the UI tree.
|
||||
_tabContent.Children().Append(activeTab->GetRootElement());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1287,11 +1270,9 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->NavigateFocus(direction);
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->NavigateFocus(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1299,12 +1280,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
return terminalTab->GetActiveTerminalControl();
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
return focusedTab->GetActiveTerminalControl();
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1327,11 +1309,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// Method Description:
|
||||
// - returns a com_ptr to the currently focused tab. This might return null,
|
||||
// so make sure to check the result!
|
||||
ITab TerminalPage::_GetFocusedTab()
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetFocusedTab()
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
return _tabs.GetAt(*index);
|
||||
return _GetStrongTabImpl(*index);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1356,8 +1338,8 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
auto tabToFocus = page->_tabs.GetAt(tabIndex);
|
||||
_tabView.SelectedItem(tabToFocus.TabViewItem());
|
||||
auto tab{ _GetStrongTabImpl(tabIndex) };
|
||||
_tabView.SelectedItem(tab->GetTabViewItem());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1379,11 +1361,9 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->ClosePane();
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->ClosePane();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1423,10 +1403,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
terminalTab->Scroll(delta);
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
focusedTab->Scroll(delta);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1459,16 +1437,9 @@ namespace winrt::TerminalApp::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
auto focusedTab = _GetTerminalTabImpl(_tabs.GetAt(*indexOpt));
|
||||
|
||||
// Do nothing if the focused tab isn't a TerminalTab
|
||||
if (!focusedTab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
auto focusedTab = _GetStrongTabImpl(*indexOpt);
|
||||
TerminalApp::TerminalSettings controlSettings;
|
||||
GUID realGuid;
|
||||
bool profileFound = false;
|
||||
@@ -1542,11 +1513,9 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
terminalTab->ResizePane(direction);
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
_UnZoomIfNeeded();
|
||||
focusedTab->ResizePane(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1567,13 +1536,11 @@ namespace winrt::TerminalApp::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*indexOpt)))
|
||||
{
|
||||
delta = std::clamp(delta, -1, 1);
|
||||
const auto control = _GetActiveControl();
|
||||
const auto termHeight = control.GetViewHeight();
|
||||
terminalTab->Scroll(termHeight * delta);
|
||||
}
|
||||
delta = std::clamp(delta, -1, 1);
|
||||
const auto control = _GetActiveControl();
|
||||
const auto termHeight = control.GetViewHeight();
|
||||
auto focusedTab{ _GetStrongTabImpl(*indexOpt) };
|
||||
focusedTab->Scroll(termHeight * delta);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -1684,10 +1651,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*index)))
|
||||
{
|
||||
return terminalTab->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
}
|
||||
auto focusedTab{ _GetStrongTabImpl(*index) };
|
||||
return focusedTab->CalcSnappedDimension(widthOrHeight, dimension);
|
||||
}
|
||||
}
|
||||
return dimension;
|
||||
@@ -1885,39 +1850,32 @@ namespace winrt::TerminalApp::implementation
|
||||
// a background thread, as to not hang/crash the UI thread.
|
||||
fire_and_forget TerminalPage::_LaunchSettings(const SettingsTarget target)
|
||||
{
|
||||
if (target == SettingsTarget::SettingsUI)
|
||||
{
|
||||
_OpenSettingsUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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();
|
||||
// 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 openFile = [](const auto& filePath) {
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, filePath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", filePath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
};
|
||||
|
||||
switch (target)
|
||||
auto openFile = [](const auto& filePath) {
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, filePath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
case SettingsTarget::DefaultsFile:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
break;
|
||||
case SettingsTarget::SettingsFile:
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
case SettingsTarget::AllFiles:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
ShellExecute(nullptr, nullptr, L"notepad", filePath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
};
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case SettingsTarget::DefaultsFile:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
break;
|
||||
case SettingsTarget::SettingsFile:
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
case SettingsTarget::AllFiles:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1945,6 +1903,10 @@ namespace winrt::TerminalApp::implementation
|
||||
_rearrangeTo = eventArgs.Index();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_UpdateCommandsForPalette();
|
||||
}
|
||||
|
||||
_UpdateTabView();
|
||||
}
|
||||
@@ -1972,17 +1934,18 @@ namespace winrt::TerminalApp::implementation
|
||||
// Unfocus all the tabs.
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
tab.Focus(FocusState::Unfocused);
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->SetFocused(false);
|
||||
}
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto tab{ _tabs.GetAt(index) };
|
||||
auto tab{ _GetStrongTabImpl(index) };
|
||||
|
||||
_tabContent.Children().Clear();
|
||||
_tabContent.Children().Append(tab.Content());
|
||||
_tabContent.Children().Append(tab->GetRootElement());
|
||||
|
||||
// GH#7409: If the tab switcher is open, then we _don't_ want to
|
||||
// automatically focus the new tab here. The tab switcher wants
|
||||
@@ -1996,12 +1959,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// need to worry about focus getting lost.
|
||||
if (CommandPalette().Visibility() != Visibility::Visible)
|
||||
{
|
||||
tab.Focus(FocusState::Programmatic);
|
||||
_UpdateMRUTab(index);
|
||||
tab->SetFocused(true);
|
||||
}
|
||||
|
||||
// Raise an event that our title changed
|
||||
_titleChangeHandlers(*this, tab.Title());
|
||||
_titleChangeHandlers(*this, tab->GetActiveTitle());
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -2036,10 +1998,8 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto newSize = e.NewSize();
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
terminalTab->ResizeContent(newSize);
|
||||
}
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->ResizeContent(newSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2096,10 +2056,9 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
terminalTab->UpdateSettings(settings, profileGuid);
|
||||
}
|
||||
// Attempt to reload the settings of any panes with this profile
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
tabImpl->UpdateSettings(settings, profileGuid);
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
@@ -2111,17 +2070,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// anymore, so we can't possibly update its settings.
|
||||
|
||||
// Update the icon of the tab for the currently focused profile in that tab.
|
||||
// Only do this for TerminalTabs. Other types of tabs won't have multiple panes
|
||||
// and profiles so the Title and Icon will be set once and only once on init.
|
||||
for (auto tab : _tabs)
|
||||
{
|
||||
if (auto terminalTab = _GetTerminalTabImpl(tab))
|
||||
{
|
||||
_UpdateTabIcon(*terminalTab);
|
||||
|
||||
// Force the TerminalTab to re-grab its currently active control's title.
|
||||
terminalTab->UpdateTitle();
|
||||
}
|
||||
auto tabImpl{ _GetStrongTabImpl(tab) };
|
||||
_UpdateTabIcon(*tabImpl);
|
||||
_UpdateTitle(*tabImpl);
|
||||
}
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
@@ -2314,6 +2267,32 @@ namespace winrt::TerminalApp::implementation
|
||||
_alwaysOnTopChangedHandlers(*this, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the tab at the given index
|
||||
// Arguments:
|
||||
// - index: an unsigned integer index to a tab in _tabs
|
||||
// Return Value:
|
||||
// - a com_ptr to the implementation type of the Tab
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetStrongTabImpl(const uint32_t index) const
|
||||
{
|
||||
winrt::com_ptr<Tab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<Tab>(_tabs.GetAt(index)));
|
||||
return tabImpl;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the given projected Tab
|
||||
// Arguments:
|
||||
// - tab: the projected type of a Tab
|
||||
// Return Value:
|
||||
// - a com_ptr to the implementation type of the Tab
|
||||
winrt::com_ptr<Tab> TerminalPage::_GetStrongTabImpl(const ::winrt::TerminalApp::Tab& tab) const
|
||||
{
|
||||
winrt::com_ptr<Tab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<Tab>(tab));
|
||||
return tabImpl;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Sets the tab split button color when a new tab color is selected
|
||||
// Arguments:
|
||||
@@ -2515,8 +2494,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return focus to the active control
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
_tabs.GetAt(*index).Focus(FocusState::Programmatic);
|
||||
_UpdateMRUTab(index.value());
|
||||
_GetStrongTabImpl(index.value())->SetFocused(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2554,143 +2532,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const uint32_t size = _tabs.Size();
|
||||
for (uint32_t i = 0; i < size; ++i)
|
||||
{
|
||||
auto command = _tabs.GetAt(i).SwitchToTabCommand();
|
||||
command.Action().Args().as<SwitchToTabArgs>().TabIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Creates a settings UI tab and focuses it. If there's already a settings UI tab open,
|
||||
// just focus the existing one.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_OpenSettingsUI()
|
||||
{
|
||||
// If we're holding the settings tab's switch command, don't create a new one, switch to the existing one.
|
||||
if (!_switchToSettingsCommand)
|
||||
{
|
||||
auto newTabImpl = winrt::make_self<SettingsTab>(_settings);
|
||||
_MakeSwitchToTabCommand(*newTabImpl, _tabs.Size());
|
||||
|
||||
// Add the new tab to the list of our tabs.
|
||||
_tabs.Append(*newTabImpl);
|
||||
_mruTabActions.Append(newTabImpl->SwitchToTabCommand());
|
||||
|
||||
// Don't capture a strong ref to the tab. If the tab is removed as this
|
||||
// is called, we don't really care anymore about handling the event.
|
||||
auto weakTab = make_weak(newTabImpl);
|
||||
|
||||
auto tabViewItem = newTabImpl->TabViewItem();
|
||||
_tabView.TabItems().Append(tabViewItem);
|
||||
|
||||
_ReapplyCompactTabSize();
|
||||
|
||||
tabViewItem.PointerPressed({ this, &TerminalPage::_OnTabClick });
|
||||
|
||||
// When the tab is closed, remove it from our list of tabs.
|
||||
newTabImpl->Closed([tabViewItem, weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
|
||||
if (auto page{ weakThis.get() })
|
||||
{
|
||||
page->_switchToSettingsCommand = nullptr;
|
||||
page->_RemoveOnCloseRoutine(tabViewItem, page);
|
||||
}
|
||||
});
|
||||
|
||||
_switchToSettingsCommand = newTabImpl->SwitchToTabCommand();
|
||||
|
||||
// This kicks off TabView::SelectionChanged, in response to which
|
||||
// we'll attach the terminal's Xaml control to the Xaml root.
|
||||
_tabView.SelectedItem(tabViewItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
_actionDispatch->DoAction(_switchToSettingsCommand.Action());
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Returns a com_ptr to the implementation type of the given tab if it's a TerminalTab.
|
||||
// If the tab is not a TerminalTab, returns nullptr.
|
||||
// Arguments:
|
||||
// - tab: the projected type of a Tab
|
||||
// Return Value:
|
||||
// - If the tab is a TerminalTab, a com_ptr to the implementation type.
|
||||
// If the tab is not a TerminalTab, nullptr
|
||||
winrt::com_ptr<TerminalTab> TerminalPage::_GetTerminalTabImpl(const ITab& tab) const
|
||||
{
|
||||
if (auto terminalTab = tab.try_as<TerminalApp::TerminalTab>())
|
||||
{
|
||||
winrt::com_ptr<TerminalTab> tabImpl;
|
||||
tabImpl.copy_from(winrt::get_self<TerminalTab>(terminalTab));
|
||||
return tabImpl;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - The TabView does not apply compact sizing to items added after Compact is enabled.
|
||||
// By forcibly reapplying compact sizing every time we add a new tab, we'll make sure
|
||||
// that it works.
|
||||
// Workaround from https://github.com/microsoft/microsoft-ui-xaml/issues/2711
|
||||
// TODO: Remove this function and its calls when ingesting the above changes.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_ReapplyCompactTabSize()
|
||||
{
|
||||
if (_tabView.TabWidthMode() == MUX::Controls::TabViewWidthMode::Compact)
|
||||
{
|
||||
_tabView.UpdateLayout();
|
||||
_tabView.TabWidthMode(MUX::Controls::TabViewWidthMode::Compact);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Initializes a SwitchToTab command object for this Tab instance.
|
||||
// This should be done before the tab is added to the _tabs vector so that
|
||||
// controls like the CmdPal that observe the vector changes can always expect
|
||||
// a SwitchToTab command to be available.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_MakeSwitchToTabCommand(const ITab& tab, const uint32_t index)
|
||||
{
|
||||
SwitchToTabArgs args{ index };
|
||||
ActionAndArgs focusTabAction{ ShortcutAction::SwitchToTab, args };
|
||||
|
||||
Command command;
|
||||
command.Action(focusTabAction);
|
||||
command.Name(tab.Title());
|
||||
command.Icon(tab.Icon());
|
||||
|
||||
tab.SwitchToTabCommand(command);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Bumps the tab in its in-order index up to the top of the mru list.
|
||||
// Arguments:
|
||||
// - index: the in-order index of the tab to bump.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_UpdateMRUTab(const uint32_t index)
|
||||
{
|
||||
uint32_t mruIndex;
|
||||
auto command = _tabs.GetAt(index).SwitchToTabCommand();
|
||||
if (_mruTabActions.IndexOf(command, mruIndex))
|
||||
{
|
||||
if (mruIndex > 0)
|
||||
{
|
||||
_mruTabActions.RemoveAt(mruIndex);
|
||||
_mruTabActions.InsertAt(0, command);
|
||||
CommandPalette().SetTabActions(_mruTabActions);
|
||||
}
|
||||
_GetStrongTabImpl(i)->UpdateTabViewIndex(i, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "TerminalPage.g.h"
|
||||
#include "TerminalTab.h"
|
||||
#include "Tab.h"
|
||||
#include "AppKeyBindings.h"
|
||||
#include "TerminalSettings.h"
|
||||
|
||||
@@ -88,14 +88,11 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<TerminalApp::ITab> _tabs;
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::Settings::Model::Command> _mruTabActions;
|
||||
winrt::com_ptr<TerminalTab> _GetTerminalTabImpl(const ITab& tab) const;
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<TerminalApp::Tab> _tabs;
|
||||
winrt::com_ptr<Tab> _GetStrongTabImpl(const uint32_t index) const;
|
||||
winrt::com_ptr<Tab> _GetStrongTabImpl(const ::winrt::TerminalApp::Tab& tab) const;
|
||||
void _UpdateTabIndices();
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::Model::Command _switchToSettingsCommand{ nullptr };
|
||||
|
||||
bool _isInFocusMode{ false };
|
||||
bool _isFullscreen{ false };
|
||||
bool _isAlwaysOnTop{ false };
|
||||
@@ -136,8 +133,8 @@ namespace winrt::TerminalApp::implementation
|
||||
void _HookupKeyBindings(const Microsoft::Terminal::Settings::Model::KeyMapping& keymap) noexcept;
|
||||
void _RegisterActionCallbacks();
|
||||
|
||||
void _UpdateTitle(const TerminalTab& tab);
|
||||
void _UpdateTabIcon(TerminalTab& tab);
|
||||
void _UpdateTitle(const Tab& tab);
|
||||
void _UpdateTabIcon(Tab& tab);
|
||||
void _UpdateTabView();
|
||||
void _UpdateTabWidthMode();
|
||||
void _UpdateCommandsForPalette();
|
||||
@@ -149,7 +146,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void _RemoveTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem);
|
||||
void _RemoveTabViewItemByIndex(uint32_t tabIndex);
|
||||
|
||||
void _RegisterTerminalEvents(Microsoft::Terminal::TerminalControl::TermControl term, TerminalTab& hostingTab);
|
||||
void _RegisterTerminalEvents(Microsoft::Terminal::TerminalControl::TermControl term, Tab& hostingTab);
|
||||
|
||||
void _SelectNextTab(const bool bMoveRight);
|
||||
bool _SelectTab(const uint32_t tabIndex);
|
||||
@@ -157,7 +154,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalControl::TermControl _GetActiveControl();
|
||||
std::optional<uint32_t> _GetFocusedTabIndex() const noexcept;
|
||||
ITab _GetFocusedTab();
|
||||
winrt::com_ptr<Tab> _GetFocusedTab();
|
||||
winrt::fire_and_forget _SetFocusedTabIndex(const uint32_t tabIndex);
|
||||
void _CloseFocusedTab();
|
||||
void _CloseFocusedPane();
|
||||
@@ -208,14 +205,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _UnZoomIfNeeded();
|
||||
|
||||
void _OpenSettingsUI();
|
||||
|
||||
void _ReapplyCompactTabSize();
|
||||
|
||||
void _MakeSwitchToTabCommand(const ITab& tab, const uint32_t index);
|
||||
void _UpdateTabSwitcherCommands(const bool mru);
|
||||
void _UpdateMRUTab(const uint32_t index);
|
||||
|
||||
#pragma region ActionHandlers
|
||||
// These are all defined in AppActionHandlers.cpp
|
||||
void _HandleOpenNewTabDropdown(const IInspectable& sender, const Microsoft::Terminal::Settings::Model::ActionEventArgs& args);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "ITab.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
{
|
||||
[default_interface] runtimeclass TerminalTab : ITab, Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,7 @@
|
||||
<ClInclude Include="../TitlebarControl.h" />
|
||||
<ClInclude Include="../TabRowControl.h" />
|
||||
<ClInclude Include="../App.h" />
|
||||
<ClInclude Include="../TerminalTab.h" />
|
||||
<ClInclude Include="../SettingsTab.h" />
|
||||
<ClInclude Include="../Tab.h" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Cpp Files ======================== -->
|
||||
<ItemGroup>
|
||||
@@ -70,7 +69,6 @@
|
||||
include Settings and Connection, since Control will include them for us) -->
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
|
||||
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as
|
||||
our TerminalApp.winmd. This didn't work correctly in VS2017, you'd need to
|
||||
|
||||
@@ -67,9 +67,7 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalAppProvider);
|
||||
|
||||
#include <winrt/Microsoft.Terminal.TerminalControl.h>
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Editor.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||
|
||||
#include <winrt/Windows.UI.Popups.h>
|
||||
|
||||
#include <CLI11/CLI11.hpp>
|
||||
|
||||
@@ -895,7 +895,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// keybindings on the keyUp, then we'll still send the keydown to the
|
||||
// connected terminal application, and something like ctrl+shift+T will
|
||||
// emit a ^T to the pipe.
|
||||
if (!modifiers.IsAltGrPressed() && keyDown && _TryHandleKeyBinding(vkey, scanCode, modifiers))
|
||||
if (!modifiers.IsAltGrPressed() && keyDown && _TryHandleKeyBinding(vkey, modifiers))
|
||||
{
|
||||
e.Handled(true);
|
||||
return;
|
||||
@@ -917,9 +917,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - Attempt to handle this key combination as a key binding
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
// - modifiers: The ControlKeyStates representing the modifier key states.
|
||||
bool TermControl::_TryHandleKeyBinding(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const
|
||||
bool TermControl::_TryHandleKeyBinding(const WORD vkey, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const
|
||||
{
|
||||
auto bindings = _settings.KeyBindings();
|
||||
if (!bindings)
|
||||
@@ -927,44 +926,12 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
return false;
|
||||
}
|
||||
|
||||
auto success = bindings.TryKeyChord({
|
||||
return bindings.TryKeyChord({
|
||||
modifiers.IsCtrlPressed(),
|
||||
modifiers.IsAltPressed(),
|
||||
modifiers.IsShiftPressed(),
|
||||
vkey,
|
||||
});
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Let's assume the user has bound the dead key "^" to a sendInput command that sends "b".
|
||||
// If the user presses the two keys "^a" it'll produce "bâ", despite us marking the key event as handled.
|
||||
// The following is used to manually "consume" such dead keys and clear them from the keyboard state.
|
||||
_ClearKeyboardState(vkey, scanCode);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Discards currently pressed dead keys.
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
void TermControl::_ClearKeyboardState(const WORD vkey, const WORD scanCode) const noexcept
|
||||
{
|
||||
std::array<BYTE, 256> keyState;
|
||||
if (!GetKeyboardState(keyState.data()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// As described in "Sometimes you *want* to interfere with the keyboard's state buffer":
|
||||
// http://archives.miloush.net/michkap/archive/2006/09/10/748775.html
|
||||
// > "The key here is to keep trying to pass stuff to ToUnicode until -1 is not returned."
|
||||
std::array<wchar_t, 16> buffer;
|
||||
while (ToUnicodeEx(vkey, scanCode, keyState.data(), buffer.data(), gsl::narrow_cast<int>(buffer.size()), 0b1, nullptr) < 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -974,7 +941,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
// - Makes the cursor briefly visible during typing.
|
||||
// Arguments:
|
||||
// - vkey: The vkey of the key pressed.
|
||||
// - scanCode: The scan code of the key pressed.
|
||||
// - states: The Microsoft::Terminal::Core::ControlKeyStates representing the modifier key states.
|
||||
// - keyDown: If true, the key was pressed, otherwise the key was released.
|
||||
bool TermControl::_TrySendKeyEvent(const WORD vkey,
|
||||
|
||||
@@ -285,8 +285,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||
|
||||
void _KeyHandler(Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e, const bool keyDown);
|
||||
::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() const;
|
||||
bool _TryHandleKeyBinding(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const;
|
||||
void _ClearKeyboardState(const WORD vkey, const WORD scanCode) const noexcept;
|
||||
bool _TryHandleKeyBinding(const WORD vkey, ::Microsoft::Terminal::Core::ControlKeyStates modifiers) const;
|
||||
bool _TrySendKeyEvent(const WORD vkey, const WORD scanCode, ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
|
||||
bool _TrySendMouseEvent(Windows::UI::Input::PointerPoint const& point);
|
||||
bool _CanSendVTMouseInput();
|
||||
|
||||
@@ -582,7 +582,7 @@ CATCH_LOG_RETURN_FALSE()
|
||||
bool Terminal::AddHyperlink(std::wstring_view uri, std::wstring_view params) noexcept
|
||||
{
|
||||
auto attr = _buffer->GetCurrentAttributes();
|
||||
const auto id = _buffer->GetHyperlinkId(uri, params);
|
||||
const auto id = _buffer->GetHyperlinkId(params);
|
||||
attr.SetHyperlinkId(id);
|
||||
_buffer->SetCurrentAttributes(attr);
|
||||
_buffer->AddHyperlinkToMap(uri, id);
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "AddProfile.h"
|
||||
#include "AddProfile.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
AddProfile::AddProfile()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AddProfile.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct AddProfile : AddProfileT<AddProfile>
|
||||
{
|
||||
AddProfile();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(AddProfile);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
AddProfile();
|
||||
}
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.AddProfile"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!--TODO: SETTINGS UI make sure there isn't a separate UI for a new profile vs existing ones.-->
|
||||
<Page.Resources>
|
||||
<Flyout x:Key="cursorColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="cursorColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="cursorColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--TODO: SETTINGS UI consolidate common styles across XAML pages. -->
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="foregroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="foregroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="foregroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="backgroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="backgroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="backgroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
<Flyout x:Key="selectionBackgroundColorPickerFlyout">
|
||||
<RelativePanel>
|
||||
<ColorPicker x:Name="selectionBackgroundColorPicker"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"/>
|
||||
|
||||
<Grid RelativePanel.Below="selectionBackgroundColorPicker"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="OK"
|
||||
Margin="0,12,2,0" HorizontalAlignment="Stretch"/>
|
||||
<Button Content="Cancel"
|
||||
Margin="2,12,0,0" HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
</RelativePanel>
|
||||
</Flyout>
|
||||
</Page.Resources>
|
||||
|
||||
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout>
|
||||
<Grid/>
|
||||
</Flyout>
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text=""
|
||||
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" Height="52">
|
||||
<GridView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
|
||||
MaximumRowsOrColumns="2"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</GridView.ItemsPanel>
|
||||
</GridView>
|
||||
<Pivot >
|
||||
<PivotItem Header="General">
|
||||
<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>
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBox Header="Name" Margin="0,0,0,10" />
|
||||
<TextBox Header="GUID" Margin="0,0,0,10" />
|
||||
<TextBox Header="Command line" Margin="0,0,0,10" />
|
||||
<TextBox Header="Starting directory" Margin="0,0,0,10" />
|
||||
<TextBox Header="Icon" Margin="0,0,0,10" />
|
||||
<TextBox Header="Tab title" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Scrollbar visibility" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="ScrollBarVisible" Content="Visible"/>
|
||||
<RadioButton x:Name="ScrollBarHidden" Content="Hidden"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
<PivotItem Header="Appearance">
|
||||
|
||||
<ScrollViewer >
|
||||
<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>
|
||||
<!-- THIS IS WHERE THE MINI-TERMINAL WOULD GO -->
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox Content="Enable acrylic" />
|
||||
<Controls:NumberBox Header="Acrylic opacity" Margin="0,0,0,10" Value="0.5" SpinButtonPlacementMode="Compact" SmallChange="0.1" LargeChange="0.25" />
|
||||
<TextBox Header="Background image" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Background image stretch mode" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="backgroundImageStretchModeNone" Content="none"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeFill" Content="fill"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeUniform" Content="uniform"/>
|
||||
<RadioButton x:Name="backgroundImageStretchModeUniformToFill" Content="uniformToFill"/>
|
||||
</Controls:RadioButtons>
|
||||
<Windows10version1809:DropDownButton Content="Background image alignment" Margin="0,0,0,10" >
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="center"/>
|
||||
<MenuFlyoutItem Text="left"/>
|
||||
<MenuFlyoutItem Text="top"/>
|
||||
<MenuFlyoutItem Text="right"/>
|
||||
<MenuFlyoutItem Text="bottom"/>
|
||||
<MenuFlyoutItem Text="topLeft"/>
|
||||
<MenuFlyoutItem Text="topRight"/>
|
||||
<MenuFlyoutItem Text="bottomLeft"/>
|
||||
<MenuFlyoutItem Text="bottomRight"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</Windows10version1809:DropDownButton>
|
||||
<Controls:NumberBox Header="Background image opacity" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="25" />
|
||||
<CheckBox Content="Retro terminal effects" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Margin="0,0,80,0">
|
||||
<TextBox Header="Font face" Margin="0,0,0,10" />
|
||||
<Controls:NumberBox Header="Font size" Margin="0,0,0,10" Value="12" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" />
|
||||
<TextBox Header="Font weight" Margin="0,0,0,10"/>
|
||||
<TextBox Header="Padding" Margin="0,0,0,10" />
|
||||
<Controls:RadioButtons Header="Cursor shape" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="CursorShapeBar" Content="Bar"/>
|
||||
<RadioButton x:Name="CursorShapeVintage" Content="Vintage"/>
|
||||
<RadioButton x:Name="CursorShapeUnderscore" Content="Underscore"/>
|
||||
<RadioButton x:Name="CursorShapeFilledBox" Content="FilledBox"/>
|
||||
<RadioButton x:Name="CursorShapeEmptyBox" Content="EmptyBox"/>
|
||||
</Controls:RadioButtons>
|
||||
<Controls:NumberBox Header="Cursor height" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" />
|
||||
<Button x:Name="cursorColorPickerButton" Content="Cursor color" Flyout="{StaticResource cursorColorPickerFlyout}"/>
|
||||
<Controls:NumberBox Header="Cursor height" Margin="0,0,0,10" Value="100" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="25" />
|
||||
<Windows10version1809:DropDownButton Content="Color scheme" Margin="0,0,0,10" >
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="Campbell"/>
|
||||
<MenuFlyoutItem Text="Campbell Powershell"/>
|
||||
<MenuFlyoutItem Text="Vintage"/>
|
||||
<MenuFlyoutItem Text="One Half Dark"/>
|
||||
<MenuFlyoutItem Text="One Half Light"/>
|
||||
<MenuFlyoutItem Text="Tango Dark"/>
|
||||
<MenuFlyoutItem Text="Tango Light"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</Windows10version1809:DropDownButton>
|
||||
<Button x:Name="foregroundColorPickerButton" Content="Foreground color" Flyout="{StaticResource foregroundColorPickerFlyout}"/>
|
||||
<Button x:Name="backgroundColorPickerButton" Content="Background color" Flyout="{StaticResource backgroundColorPickerFlyout}"/>
|
||||
<Button x:Name="selectionBackgroundColorPickerButton" Content="Selection background color" Flyout="{StaticResource selectionBackgroundColorPickerFlyout}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
<PivotItem Header="Advanced">
|
||||
<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>
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox Content="Hide profile from dropdown" />
|
||||
<CheckBox Content="Suppress title changes" />
|
||||
<Controls:RadioButtons Header="Antialiasing text" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="antialiasingTextGrayscale" Content="grayscale"/>
|
||||
<RadioButton x:Name="antialiasingTextCleartype" Content="cleartype"/>
|
||||
<RadioButton x:Name="antialiasingTextAliased" Content="aliased"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox Content="AltGr aliasing" />
|
||||
<CheckBox Content="Scroll to input when typing" />
|
||||
<Controls:NumberBox Header="History size" Margin="0,0,0,10" Value="9001" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="100" />
|
||||
<Controls:RadioButtons Header="How the profile closes" Margin="0,0,0,10">
|
||||
<RadioButton x:Name="closeOnExitGraceful" Content="graceful"/>
|
||||
<RadioButton x:Name="closeOnExitAlways" Content="always"/>
|
||||
<RadioButton x:Name="closeOnExitNever" Content="never"/>
|
||||
<RadioButton x:Name="closeOnExitTrue" Content="true"/>
|
||||
<RadioButton x:Name="closeOnExitFalse" Content="false"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
</RelativePanel>
|
||||
</Page>
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.h"
|
||||
#include "ColorSchemes.h"
|
||||
#include "ColorTableEntry.g.cpp"
|
||||
#include "ColorSchemes.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
using namespace winrt::Windows::UI::Xaml::Media;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
static constexpr std::array<std::string_view, 16> TableColors = {
|
||||
"Black",
|
||||
"Red",
|
||||
"Green",
|
||||
"Yellow",
|
||||
"Blue",
|
||||
"Purple",
|
||||
"Cyan",
|
||||
"White",
|
||||
"Bright Black",
|
||||
"Bright Red",
|
||||
"Bright Green",
|
||||
"Bright Yellow",
|
||||
"Bright Blue",
|
||||
"Bright Purple",
|
||||
"Bright Cyan",
|
||||
"Bright White"
|
||||
};
|
||||
|
||||
ColorSchemes::ColorSchemes() :
|
||||
_ColorSchemeList{ single_threaded_observable_vector<hstring>() },
|
||||
_CurrentColorTable{ single_threaded_observable_vector<Editor::ColorTableEntry>() }
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Initialize our list of color schemes and initially set color scheme and table.
|
||||
auto colorSchemeMap = MainPage::Settings().GlobalSettings().ColorSchemes();
|
||||
for (const auto& pair : MainPage::Settings().GlobalSettings().ColorSchemes())
|
||||
{
|
||||
_ColorSchemeList.Append(pair.Key());
|
||||
}
|
||||
}
|
||||
|
||||
IObservableVector<hstring> ColorSchemes::ColorSchemeList()
|
||||
{
|
||||
return _ColorSchemeList;
|
||||
}
|
||||
|
||||
void ColorSchemes::ColorSchemeSelectionChanged(IInspectable const& /*sender*/,
|
||||
SelectionChangedEventArgs const& args)
|
||||
{
|
||||
// Update the color scheme this page is modifying
|
||||
auto str = winrt::unbox_value<hstring>(args.AddedItems().GetAt(0));
|
||||
auto colorScheme = MainPage::Settings().GlobalSettings().ColorSchemes().Lookup(str);
|
||||
CurrentColorScheme(colorScheme);
|
||||
_UpdateColorTable(colorScheme);
|
||||
}
|
||||
|
||||
void ColorSchemes::_UpdateColorSchemeList()
|
||||
{
|
||||
auto colorSchemeMap = MainPage::Settings().GlobalSettings().ColorSchemes();
|
||||
for (const auto& pair : MainPage::Settings().GlobalSettings().ColorSchemes())
|
||||
{
|
||||
_ColorSchemeList.Append(pair.Key());
|
||||
}
|
||||
}
|
||||
|
||||
void ColorSchemes::ColorPickerChanged(IInspectable const& sender,
|
||||
ColorChangedEventArgs const& /*args*/)
|
||||
{
|
||||
if (auto picker = sender.try_as<ColorPicker>())
|
||||
{
|
||||
// TODO: Commented out for now because Tag currently won't bind to an index correctly.
|
||||
// The idea is this function will grab the index from the tag and call SetColorTableEntry.
|
||||
//auto index = winrt::unbox_value<uint8_t>(picker.Tag());
|
||||
//CurrentColorScheme().SetColorTableEntry(index, args.NewColor());
|
||||
}
|
||||
}
|
||||
|
||||
// Update the Page's displayed color table
|
||||
void ColorSchemes::_UpdateColorTable(const Model::ColorScheme& colorScheme)
|
||||
{
|
||||
_CurrentColorTable.Clear();
|
||||
for (uint8_t i = 0; i < TableColors.size(); ++i)
|
||||
{
|
||||
auto entry = winrt::make<ColorTableEntry>(i, colorScheme.Table()[i]);
|
||||
_CurrentColorTable.Append(entry);
|
||||
}
|
||||
}
|
||||
|
||||
ColorTableEntry::ColorTableEntry(uint32_t index, Windows::UI::Color color)
|
||||
{
|
||||
Index(winrt::box_value(index));
|
||||
Color(color);
|
||||
Name(to_hstring(TableColors[index]));
|
||||
}
|
||||
|
||||
Windows::UI::Xaml::Media::Brush ColorTableEntry::ColorToBrush(Windows::UI::Color color)
|
||||
{
|
||||
return SolidColorBrush(color);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ColorTableEntry.g.h"
|
||||
#include "ColorSchemes.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct ColorSchemes : ColorSchemesT<ColorSchemes>
|
||||
{
|
||||
ColorSchemes();
|
||||
|
||||
void ColorSchemeSelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& args);
|
||||
void ColorPickerChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::ColorChangedEventArgs const& args);
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::hstring> ColorSchemeList();
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::ColorScheme, CurrentColorScheme, _PropertyChangedHandlers, nullptr);
|
||||
GETSET_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::ColorTableEntry>, CurrentColorTable, nullptr);
|
||||
|
||||
private:
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::hstring> _ColorSchemeList{ nullptr };
|
||||
|
||||
void _UpdateColorTable(const winrt::Microsoft::Terminal::Settings::Model::ColorScheme& colorScheme);
|
||||
void _UpdateColorSchemeList();
|
||||
};
|
||||
|
||||
struct ColorTableEntry : ColorTableEntryT<ColorTableEntry>
|
||||
{
|
||||
public:
|
||||
ColorTableEntry() = default;
|
||||
ColorTableEntry(uint32_t index, Windows::UI::Color color);
|
||||
|
||||
Windows::UI::Xaml::Media::Brush ColorToBrush(Windows::UI::Color color);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Name, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(IInspectable, Index, _PropertyChangedHandlers, nullptr);
|
||||
OBSERVABLE_GETSET_PROPERTY(Windows::UI::Color, Color, _PropertyChangedHandlers);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ColorSchemes);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
ColorSchemes();
|
||||
|
||||
Microsoft.Terminal.Settings.Model.ColorScheme CurrentColorScheme { get; };
|
||||
Windows.Foundation.Collections.IObservableVector<ColorTableEntry> CurrentColorTable;
|
||||
Windows.Foundation.Collections.IObservableVector<String> ColorSchemeList { get; };
|
||||
}
|
||||
|
||||
[default_interface] runtimeclass ColorTableEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
String Name { get; };
|
||||
IInspectable Index { get; };
|
||||
Windows.UI.Color Color;
|
||||
|
||||
Windows.UI.Xaml.Media.Brush ColorToBrush(Windows.UI.Color color);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.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.Editor"
|
||||
xmlns:model="using:Microsoft.Terminal.Settings.Model"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows.Foundation.UniversalApiContract" xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<Page.Resources>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Margin" Value="0,0,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource SystemBaseLowColor}"/>
|
||||
<Setter Property="Height" Value="37" />
|
||||
<Setter Property="Width" Value="37" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="Margin" Value="10,22,0,0" />
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="Width" Value="100"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
</Style>
|
||||
|
||||
<local:ColorToHexConverter x:Key="ColorToHexConverter"/>
|
||||
|
||||
<DataTemplate x:Key="ColorTableTemplate" x:DataType="local:ColorTableEntry">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Header="{x:Bind Name, Mode=OneWay}"
|
||||
Text="{x:Bind Color, Converter={StaticResource ColorToHexConverter}, Mode=TwoWay}"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Button Background="{x:Bind ColorToBrush(Color), Mode=OneWay}">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker Tag="{x:Bind Index, Mode=OneWay}"
|
||||
Color="{x:Bind Color, Mode=TwoWay}"
|
||||
IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True"
|
||||
ColorChanged="ColorPickerChanged"/>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Page.Resources>
|
||||
|
||||
<ScrollViewer>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Uid="ColorScheme_ColorSchemes"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20"
|
||||
Grid.Row="0" />
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0">
|
||||
<ComboBox x:Name="ColorSchemeComboBox"
|
||||
SelectedIndex="0"
|
||||
ItemsSource="{x:Bind ColorSchemeList, Mode=OneWay}"
|
||||
SelectionChanged="ColorSchemeSelectionChanged" Width="160">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl x:Name="ColorTableControl"
|
||||
ItemsSource="{x:Bind CurrentColorTable, Mode=TwoWay}"
|
||||
ItemTemplate="{StaticResource ColorTableTemplate}">
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,37 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "ColorToHexConverter.h"
|
||||
#include "ColorToHexConverter.g.cpp"
|
||||
|
||||
using namespace winrt::Windows;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Foundation::IInspectable ColorToHexConverter::Convert(Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /* parameter */,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
til::color color{ winrt::unbox_value<winrt::Windows::UI::Color>(value) };
|
||||
auto hex = winrt::to_hstring(color.ToHexString().data());
|
||||
return winrt::box_value(hex);
|
||||
}
|
||||
|
||||
Foundation::IInspectable ColorToHexConverter::ConvertBack(Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
|
||||
Foundation::IInspectable const& /* parameter */,
|
||||
hstring const& /* language */)
|
||||
{
|
||||
auto str = winrt::unbox_value<winrt::hstring>(value);
|
||||
std::wstring hex{ str.data() };
|
||||
Windows::UI::Color newColor;
|
||||
newColor.A = base::checked_cast<uint8_t>(std::stoi(hex.substr(1, 2), nullptr, 16));
|
||||
newColor.R = base::checked_cast<uint8_t>(std::stoi(hex.substr(3, 2), nullptr, 16));
|
||||
newColor.G = base::checked_cast<uint8_t>(std::stoi(hex.substr(5, 2), nullptr, 16));
|
||||
newColor.B = base::checked_cast<uint8_t>(std::stoi(hex.substr(7, 2), nullptr, 16));
|
||||
return winrt::box_value(newColor);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ColorToHexConverter.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct ColorToHexConverter : ColorToHexConverterT<ColorToHexConverter>
|
||||
{
|
||||
ColorToHexConverter() = default;
|
||||
|
||||
Windows::Foundation::IInspectable Convert(Windows::Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& targetType,
|
||||
Windows::Foundation::IInspectable const& parameter,
|
||||
hstring const& language);
|
||||
|
||||
Windows::Foundation::IInspectable ConvertBack(Windows::Foundation::IInspectable const& value,
|
||||
Windows::UI::Xaml::Interop::TypeName const& targetType,
|
||||
Windows::Foundation::IInspectable const& parameter,
|
||||
hstring const& language);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ColorToHexConverter);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass ColorToHexConverter : [default] Windows.UI.Xaml.Data.IValueConverter
|
||||
{
|
||||
ColorToHexConverter();
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor">
|
||||
|
||||
<Style x:Key="GridViewItemStyle" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="0,0,12,12" />
|
||||
</Style>
|
||||
<Style x:Key="IndentedGridViewItemStyle" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="12,0,0,12" />
|
||||
</Style>
|
||||
<Style x:Key="GridViewItemStyleSmall" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="0,0,0,12" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style x:Key="IndentedGridViewItemStyleSmall" TargetType="GridViewItem">
|
||||
<Setter Property="Margin" Value="12,0,12,12" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "GlobalAppearance.h"
|
||||
#include "GlobalAppearance.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
GlobalAppearance::GlobalAppearance()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings GlobalAppearance::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GlobalAppearance.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct GlobalAppearance : GlobalAppearanceT<GlobalAppearance>
|
||||
{
|
||||
GlobalAppearance();
|
||||
winrt::Microsoft::Terminal::Settings::Model::GlobalAppSettings GlobalSettings();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(GlobalAppearance);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass GlobalAppearance : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
GlobalAppearance();
|
||||
Microsoft.Terminal.Settings.Model.GlobalAppSettings GlobalSettings { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<!--TODO: SETTINGS UI All strings must be attached to UIDs-->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.GlobalAppearance"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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">
|
||||
<ScrollViewer>
|
||||
<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 x:Uid="Globals_GlobalAppearance"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<Controls:RadioButtons x:Uid="Globals_Theme" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Globals_ThemeDefault" x:Name="DefaultTheme"/>
|
||||
<RadioButton x:Uid="Globals_ThemeDark" x:Name="DarkTheme"/>
|
||||
<RadioButton x:Uid="Globals_ThemeLight" x:Name="LightTheme"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox x:Uid="Globals_ShowTitlebar" IsChecked="{x:Bind GlobalSettings.ShowTabsInTitlebar, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_ShowTitleInTitlebar" IsChecked="{x:Bind GlobalSettings.ShowTitleInTitlebar, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_AlwaysShowTabs" IsChecked="{x:Bind GlobalSettings.AlwaysShowTabs, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<Controls:RadioButtons x:Uid="Globals_TabWidthMode" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Globals_TabWidthModeEqual" x:Name="EqualTabWidthMode"/>
|
||||
<RadioButton x:Uid="Globals_TabWidthModeTitleLength" x:Name="TitleLengthTabWidthMode"/>
|
||||
<RadioButton x:Uid="Globals_TabWidthModeCompact" x:Name="CompactTabWidthMode"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox x:Uid="Globals_ConfirmCloseAllTabs" IsChecked="{x:Bind GlobalSettings.ConfirmCloseAllTabs, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "SettingsTypes.idl";
|
||||
|
||||
namespace SettingsControl
|
||||
{
|
||||
[default_interface] runtimeclass GlobalSettings {
|
||||
GlobalSettings();
|
||||
|
||||
String UnparsedDefaultProfile();
|
||||
|
||||
Guid DefaultProfile;
|
||||
Int32 InitialRows;
|
||||
Int32 InitialCols;
|
||||
Boolean AlwaysShowTabs;
|
||||
Boolean ShowTitleInTitlebar;
|
||||
Boolean ConfirmCloseAllTabs;
|
||||
Windows.UI.Xaml.ElementTheme Theme;
|
||||
TabWidthMode TabWidth;
|
||||
Boolean ShowTabsInTitlebar;
|
||||
String WordDelimiters;
|
||||
Boolean CopyOnSelect;
|
||||
Boolean CopyFormatting;
|
||||
Boolean WarnAboutLargePaste;
|
||||
Boolean WarnAboutMultiLinePaste;
|
||||
Boolean SnapToGridOnResize;
|
||||
Boolean ForceFullRepaintRendering;
|
||||
Boolean SoftwareRendering;
|
||||
Boolean ForceVTInput;
|
||||
Boolean DebugFeaturesEnabled;
|
||||
Boolean StartOnUserLogin;
|
||||
Boolean AlwaysOnTop;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Globals.h"
|
||||
#include "Globals.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Globals::Globals()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Globals.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Globals : GlobalsT<Globals>
|
||||
{
|
||||
Globals();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Globals);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Globals : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Globals();
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.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.Editor"
|
||||
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 delimiters" 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,40 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Home.h"
|
||||
#include "Home.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Home::Home()
|
||||
{
|
||||
m_homeViewModel = winrt::make<SettingsEditorViewModel>();
|
||||
InitializeComponent();
|
||||
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Startup", L"Launch_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Interaction", L"Interaction_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Rendering", L"Rendering_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Global appearance", L"GlobalAppearance_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Color schemes", L"ColorSchemes_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Global profile settings", L"GlobalProfile_Nav"));
|
||||
HomeViewModel().HomeGridItems().Append(winrt::make<HomeGridItem>(L"Keyboard", L"Keyboard_Nav"));
|
||||
}
|
||||
|
||||
void Home::HomeGridItemClickHandler(IInspectable const&, Controls::ItemClickEventArgs const& args)
|
||||
{
|
||||
auto clickedItemContainer = args.ClickedItem().as<HomeGridItem>();
|
||||
hstring tag = clickedItemContainer->PageTag();
|
||||
MainPage::Navigate(frame(), tag);
|
||||
}
|
||||
|
||||
Editor::SettingsEditorViewModel Home::HomeViewModel()
|
||||
{
|
||||
return m_homeViewModel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Home.g.h"
|
||||
#include "SettingsEditorViewModel.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Home : HomeT<Home>
|
||||
{
|
||||
Home();
|
||||
|
||||
Editor::SettingsEditorViewModel HomeViewModel();
|
||||
|
||||
void HomeGridItemClickHandler(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Controls::ItemClickEventArgs const& args);
|
||||
|
||||
private:
|
||||
Editor::SettingsEditorViewModel m_homeViewModel{ nullptr };
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Home);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "SettingsEditorViewModel.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass Home : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Home();
|
||||
SettingsEditorViewModel HomeViewModel{ get; };
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Home"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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">
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="CommonResources.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
<ScrollViewer>
|
||||
<Frame x:Name="frame">
|
||||
<Frame.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<NavigationThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</Frame.ContentTransitions>
|
||||
<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 Grid.Row="0"
|
||||
Text="Windows Terminal Settings"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
TextAlignment="Center"
|
||||
Margin="0,0,0,20" />
|
||||
<GridView Grid.Row="1"
|
||||
x:Name="HomeGridView"
|
||||
ItemsSource="{x:Bind HomeViewModel.HomeGridItems}"
|
||||
ItemContainerStyle="{StaticResource GridViewItemStyle}"
|
||||
IsItemClickEnabled="True"
|
||||
SelectionMode="None"
|
||||
ItemClick="HomeGridItemClickHandler">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate x:DataType="local:HomeGridItem">
|
||||
<UserControl>
|
||||
<Grid
|
||||
x:Name="homeGridItemRoot"
|
||||
Width="344"
|
||||
Height="140"
|
||||
Padding="12"
|
||||
Background="{ThemeResource SystemControlBackgroundListLowBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<RelativePanel Grid.Column="1" Grid.ColumnSpan="2" Margin="16,6,0,0">
|
||||
<TextBlock
|
||||
x:Name="titleText"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Text="{x:Bind Title}"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
TextLineBounds="TrimToCapHeight"
|
||||
TextWrapping="NoWrap" />
|
||||
</RelativePanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "HomeGridItem.h"
|
||||
#include "HomeGridItem.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
HomeGridItem::HomeGridItem(hstring const& title, hstring const& pageTag) :
|
||||
_Title{ title },
|
||||
_PageTag{ pageTag }
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
#include "HomeGridItem.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct HomeGridItem : HomeGridItemT<HomeGridItem>
|
||||
{
|
||||
HomeGridItem() = delete;
|
||||
HomeGridItem(hstring const& title, hstring const& pageTag);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
OBSERVABLE_GETSET_PROPERTY(hstring, Title, _PropertyChangedHandlers);
|
||||
OBSERVABLE_GETSET_PROPERTY(hstring, PageTag, _PropertyChangedHandlers);
|
||||
};
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass HomeGridItem : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
String Title;
|
||||
String PageTag;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Interaction.h"
|
||||
#include "Interaction.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Interaction::Interaction()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings Interaction::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Interaction.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Interaction : InteractionT<Interaction>
|
||||
{
|
||||
Interaction();
|
||||
winrt::Microsoft::Terminal::Settings::Model::GlobalAppSettings GlobalSettings();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Interaction);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass Interaction : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Interaction();
|
||||
Microsoft.Terminal.Settings.Model.GlobalAppSettings GlobalSettings { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Interaction"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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">
|
||||
<ScrollViewer>
|
||||
<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 x:Uid="Globals_Interaction"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox x:Uid="Globals_CopyOnSelect" IsChecked="{x:Bind GlobalSettings.CopyOnSelect, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<!--TODO: Converter Here-->
|
||||
<!--<CheckBox x:Uid="Globals_CopyFormatting" IsChecked="{x:Bind GlobalSettings.CopyFormatting, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />-->
|
||||
<TextBox x:Uid="Globals_WordDelimiters" Text="{x:Bind GlobalSettings.WordDelimiters, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_SnapToGridOnResize" IsChecked="{x:Bind GlobalSettings.SnapToGridOnResize, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,17 +0,0 @@
|
||||
<Page
|
||||
x:Class="TerminalSettings.KeyBindingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:TerminalSettings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<Grid>
|
||||
|
||||
<TextBox IsEnabled="False" Name=""/>
|
||||
<Button x:Name="asdf" Click="">Click me</Button>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,239 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Keybindings.h"
|
||||
#include "Keybindings.g.cpp"
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Input;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace winrt::Microsoft::Terminal::Settings;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Keybindings::Keybindings()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
m_optionalSettingsPanel = FindName(L"OptionalSettingsPanel").as<Controls::StackPanel>();
|
||||
m_addNewButton = FindName(L"AddNewLink").as<Controls::HyperlinkButton>();
|
||||
|
||||
Controls::TextBox tb = FindName(L"KeyBindTextBox").as<Controls::TextBox>();
|
||||
tb.KeyDown({ this, &Keybindings::KeyDown });
|
||||
}
|
||||
|
||||
void Keybindings::Button_Click(IInspectable const& /*sender*/, RoutedEventArgs const& /*e*/)
|
||||
{
|
||||
Popup popup = FindName(L"StandardPopup").as<Popup>();
|
||||
|
||||
if (!popup.IsOpen())
|
||||
{
|
||||
popup.IsOpen(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Keybindings::AddNewButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& /*e*/)
|
||||
{
|
||||
hstring setting = GetSelectedItemTag(FindName(L"CommandComboBox"));
|
||||
|
||||
Controls::StackPanel panel{};
|
||||
|
||||
if (setting == c_moveFocusTag || setting == c_resizePaneTag)
|
||||
{
|
||||
panel = FindName(L"moveResizeFocusOptionPanel").as<Controls::StackPanel>();
|
||||
panel.Visibility(Visibility::Visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
panel = FindName(setting + L"OptionPanel").as<Controls::StackPanel>();
|
||||
bool panelWasVisible = (panel.Visibility() == Visibility::Visible);
|
||||
panel.Visibility(Visibility::Visible);
|
||||
m_lastOpenedArgsPanel = panel;
|
||||
|
||||
Controls::HyperlinkButton button = sender.as<Controls::HyperlinkButton>();
|
||||
if (setting == c_splitPaneTag)
|
||||
{
|
||||
if (panelWasVisible)
|
||||
{
|
||||
panel.Children().Append(SplitPaneOptionPanelControl());
|
||||
}
|
||||
button.Visibility(Visibility::Visible);
|
||||
}
|
||||
else if (setting == c_newTabTag)
|
||||
{
|
||||
panel.Children().Append(NewTabOptionPanelControl());
|
||||
button.Visibility(Visibility::Visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
button.Visibility(Visibility::Collapsed);
|
||||
}
|
||||
}
|
||||
|
||||
m_lastOpenedArgsPanel = panel;
|
||||
}
|
||||
|
||||
hstring Keybindings::GetKeyListString()
|
||||
{
|
||||
hstring generatedString = L"";
|
||||
boolean lastKeyWasModifier{};
|
||||
|
||||
if (m_keysInBind.find(VirtualKey::Control) != m_keysInBind.end())
|
||||
{
|
||||
generatedString = generatedString + KeyToString(VirtualKey::Control);
|
||||
lastKeyWasModifier = true;
|
||||
}
|
||||
|
||||
if (m_keysInBind.find(VirtualKey::Shift) != m_keysInBind.end())
|
||||
{
|
||||
generatedString = generatedString + KeyToString(VirtualKey::Shift);
|
||||
lastKeyWasModifier = true;
|
||||
}
|
||||
|
||||
if (m_keysInBind.find(VirtualKey::Menu) != m_keysInBind.end())
|
||||
{
|
||||
generatedString = generatedString + KeyToString(VirtualKey::Menu);
|
||||
lastKeyWasModifier = true;
|
||||
}
|
||||
|
||||
for (const auto& key : m_keysInBind)
|
||||
{
|
||||
if (key != VirtualKey::Control && key != VirtualKey::Shift && key != VirtualKey::Menu)
|
||||
{
|
||||
hstring keyString = KeyToString(key);
|
||||
|
||||
if (!keyString.empty())
|
||||
{
|
||||
if (!generatedString.empty() && !lastKeyWasModifier)
|
||||
{
|
||||
generatedString = generatedString + L"+";
|
||||
}
|
||||
generatedString = generatedString + KeyToString(key);
|
||||
lastKeyWasModifier = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return generatedString;
|
||||
}
|
||||
|
||||
void Keybindings::KeyDown(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e)
|
||||
{
|
||||
Controls::TextBox textBox = sender.as<Controls::TextBox>();
|
||||
|
||||
if (e.Key() == VirtualKey::Back)
|
||||
{
|
||||
m_keysInBind.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_keysInBind.insert(e.Key());
|
||||
if (textBox != nullptr)
|
||||
{
|
||||
textBox.Text(GetKeyListString());
|
||||
}
|
||||
}
|
||||
|
||||
e.Handled(true);
|
||||
}
|
||||
|
||||
void Keybindings::KeyBindTextBox_TextChanging(winrt::Windows::UI::Xaml::Controls::TextBox const& sender, winrt::Windows::UI::Xaml::Controls::TextBoxTextChangingEventArgs const& /*args*/)
|
||||
{
|
||||
hstring currText = sender.Text();
|
||||
hstring newText = hstring(currText.data(), currText.size());
|
||||
|
||||
sender.Text(newText);
|
||||
}
|
||||
|
||||
void Keybindings::ShowOptionsButtonIfRequired(hstring tag)
|
||||
{
|
||||
std::set<hstring> settingsWithOptions;
|
||||
settingsWithOptions.insert(c_openSettingsTag);
|
||||
settingsWithOptions.insert(c_newTabTag);
|
||||
settingsWithOptions.insert(c_switchToTabTag);
|
||||
settingsWithOptions.insert(c_renameTabTag);
|
||||
settingsWithOptions.insert(c_setTabColorTag);
|
||||
settingsWithOptions.insert(c_moveFocusTag);
|
||||
settingsWithOptions.insert(c_resizePaneTag);
|
||||
settingsWithOptions.insert(c_splitPaneTag);
|
||||
settingsWithOptions.insert(c_copyTag);
|
||||
|
||||
Windows::UI::Xaml::Visibility expectedVisibility = Visibility::Collapsed;
|
||||
if (settingsWithOptions.find(tag) != settingsWithOptions.end())
|
||||
{
|
||||
expectedVisibility = Visibility::Visible;
|
||||
}
|
||||
m_optionalSettingsPanel.Visibility(expectedVisibility);
|
||||
m_addNewButton.Visibility(expectedVisibility);
|
||||
if (m_lastOpenedArgsPanel != nullptr)
|
||||
{
|
||||
m_lastOpenedArgsPanel.Visibility(Visibility::Collapsed);
|
||||
}
|
||||
}
|
||||
|
||||
void Keybindings::CommandComboBox_SelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& /*e*/)
|
||||
{
|
||||
hstring selectedItemTag = GetSelectedItemTag(sender);
|
||||
ShowOptionsButtonIfRequired(selectedItemTag);
|
||||
}
|
||||
|
||||
void Keybindings::SaveButton_Click(winrt::Windows::Foundation::IInspectable const& /*sender*/, winrt::Windows::UI::Xaml::RoutedEventArgs const& /*e*/)
|
||||
{
|
||||
// Collect the information here
|
||||
winrt::Windows::UI::Popups::MessageDialog msg{ CollectInputData() };
|
||||
msg.ShowAsync();
|
||||
}
|
||||
|
||||
hstring Keybindings::TraversePanel(const Controls::Panel& panel)
|
||||
{
|
||||
hstring fullInfo;
|
||||
|
||||
for (const auto panelChild : panel.Children())
|
||||
{
|
||||
if (Controls::ComboBox childComboBox = panelChild.try_as<Controls::ComboBox>())
|
||||
{
|
||||
fullInfo = fullInfo + childComboBox.Name() + L":" + GetSelectedItemTag(childComboBox);
|
||||
}
|
||||
else if (Controls::TextBox childTextBox = panelChild.try_as<Controls::TextBox>())
|
||||
{
|
||||
fullInfo = fullInfo + childTextBox.Name() + L":" + childTextBox.Text();
|
||||
}
|
||||
else if (Editor::NewTabOptionPanelControl ntOptionPanel = panelChild.try_as<Editor::NewTabOptionPanelControl>())
|
||||
{
|
||||
fullInfo = fullInfo + ntOptionPanel.Argument() + L":" + ntOptionPanel.InputValue();
|
||||
}
|
||||
else if (Editor::SplitPaneOptionPanelControl spOptionPanel = panelChild.try_as<Editor::SplitPaneOptionPanelControl>())
|
||||
{
|
||||
fullInfo = fullInfo + spOptionPanel.Argument() + L":" + spOptionPanel.InputValue();
|
||||
}
|
||||
else if (Controls::Grid grid = panelChild.try_as<Controls::Grid>())
|
||||
{
|
||||
fullInfo = fullInfo + TraversePanel(grid);
|
||||
}
|
||||
fullInfo = fullInfo + L"\n";
|
||||
}
|
||||
|
||||
return fullInfo;
|
||||
}
|
||||
|
||||
hstring Keybindings::CollectInputData()
|
||||
{
|
||||
hstring fullInfo;
|
||||
|
||||
Controls::ComboBox comboBox = FindName(L"CommandComboBox").as<Controls::ComboBox>();
|
||||
fullInfo = fullInfo + comboBox.Name() + L":" + GetSelectedItemTag(comboBox) + L"\n";
|
||||
|
||||
Controls::TextBox textBox = FindName(L"KeyBindTextBox").as<Controls::TextBox>();
|
||||
fullInfo = fullInfo + textBox.Name() + L":" + textBox.Text() + L"\n";
|
||||
|
||||
fullInfo = fullInfo + TraversePanel(m_lastOpenedArgsPanel);
|
||||
|
||||
return fullInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Keybindings.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Keybindings : KeybindingsT<Keybindings>
|
||||
{
|
||||
Keybindings();
|
||||
|
||||
void Button_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
void AddNewButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
void KeyDown(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
|
||||
void KeyBindTextBox_TextChanging(winrt::Windows::UI::Xaml::Controls::TextBox const& sender, winrt::Windows::UI::Xaml::Controls::TextBoxTextChangingEventArgs const& args);
|
||||
void CommandComboBox_SelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& e);
|
||||
void SaveButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
|
||||
private:
|
||||
hstring GetKeyListString();
|
||||
void ShowOptionsButtonIfRequired(hstring tag);
|
||||
hstring CollectInputData();
|
||||
hstring TraversePanel(const winrt::Windows::UI::Xaml::Controls::Panel& panel);
|
||||
|
||||
const hstring c_openSettingsTag = L"openSettings";
|
||||
const hstring c_newTabTag = L"newTab";
|
||||
const hstring c_switchToTabTag = L"switchToTab";
|
||||
const hstring c_renameTabTag = L"renameTab";
|
||||
const hstring c_setTabColorTag = L"setTabColor";
|
||||
const hstring c_moveFocusTag = L"moveFocus";
|
||||
const hstring c_resizePaneTag = L"resizePane";
|
||||
const hstring c_splitPaneTag = L"splitPane";
|
||||
const hstring c_copyTag = L"copy";
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::StackPanel m_lastOpenedArgsPanel{};
|
||||
winrt::Windows::UI::Xaml::Controls::StackPanel m_optionalSettingsPanel{};
|
||||
winrt::Windows::UI::Xaml::Controls::HyperlinkButton m_addNewButton{};
|
||||
|
||||
std::set<winrt::Windows::System::VirtualKey> m_keysInBind;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Keybindings);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass Keybindings : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Keybindings();
|
||||
}
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.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.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="TitleTextBox"
|
||||
Text="Keyboard"
|
||||
Style="{StaticResource HeaderTextBlockStyle}"
|
||||
Margin="0,0,0,8" />
|
||||
|
||||
<Button Click="Button_Click">Open Window</Button>
|
||||
|
||||
<Popup VerticalOffset="10" HorizontalOffset="200" x:Name="StandardPopup">
|
||||
<Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}"
|
||||
Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
|
||||
BorderThickness="1" MinWidth="600" MinHeight="300" MaxHeight="700" Margin="10">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="20">
|
||||
<TextBlock x:Name="PopupTitleTextBox" Text="Edit" Style="{StaticResource HeaderTextBlockStyle}" Margin="0,8,0,0" />
|
||||
<TextBlock Text="Command" HorizontalAlignment="Left" Margin="0,8,0,0" />
|
||||
<ComboBox HorizontalAlignment="Stretch" Name="CommandComboBox" SelectionChanged="CommandComboBox_SelectionChanged" Margin="0,8,0,0">
|
||||
<!-- Application-level commands -->
|
||||
<ComboBoxItem Content="Close the window" Tag="closeWindow"/>
|
||||
<ComboBoxItem Content="Find" Tag="find"/>
|
||||
<ComboBoxItem Content="Open the new tab dropdown menu" Tag="openNewTabDropdown"/>
|
||||
<ComboBoxItem Content="Open settings files" Tag="openSettings"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Toggle full screen" Tag="toggleFullscreen"/>
|
||||
<ComboBoxItem Content="Toggle focus mode" Tag="toggleFocusMode"/>
|
||||
<ComboBoxItem Content="Toggle always on top mode" Tag="toggleAlwaysOnTop"/>
|
||||
|
||||
<!-- Tab management commands -->
|
||||
<ComboBoxItem Content="Close the tab" Tag="closeTab"/>
|
||||
<ComboBoxItem Content="Duplicate tab" Tag="duplicateTab"/>
|
||||
<ComboBoxItem Content="New tab" Tag="newTab"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Open next tab" Tag="nextTab"/>
|
||||
<ComboBoxItem Content="Open previous tab" Tag="prevTab"/>
|
||||
<ComboBoxItem Content="Open a specific tab" Tag="switchToTab"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Rename tab" Tag="renameTab"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Change tab color" Tag="setTabColor"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Open tab color picker" Tag="openTabColorPicker"/>
|
||||
|
||||
<!-- Pane management commands -->
|
||||
<ComboBoxItem Content="Close pane" Tag="closePane"/>
|
||||
<ComboBoxItem Content="Move pane focus" Tag="moveFocus"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Resize pane" Tag="resizePane"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Split a pane" Tag="splitPane"/>
|
||||
<!-- Can have opt values -->
|
||||
|
||||
<!-- Clipboard integration commands -->
|
||||
<ComboBoxItem Content="Copy" Tag="copy"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Paste" Tag="paste"/>
|
||||
<ComboBoxItem Content="Scroll up" Tag="scrollUp"/>
|
||||
<ComboBoxItem Content="Scroll down" Tag="scrollDown"/>
|
||||
<ComboBoxItem Content="Scroll up a whole page" Tag="scrollUpPage"/>
|
||||
<ComboBoxItem Content="Scroll down a whole page" Tag="scrollDownPage"/>
|
||||
|
||||
<!-- Visual adjustment commands -->
|
||||
<ComboBoxItem Content="Adjust font size" Tag="adjustFontSize"/>
|
||||
<!-- Can have opt values -->
|
||||
<ComboBoxItem Content="Reset font size" Tag="resetFontSize"/>
|
||||
<ComboBoxItem Content="Toggle retro terminal effects" Tag="toggleRetroEffect"/>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Visibility="Collapsed" Name="OptionalSettingsPanel">
|
||||
<TextBlock Text="Arguments" Style="{StaticResource SubheaderTextBlockStyle}" Margin="0,8,0,0"/>
|
||||
|
||||
<!-- Args for Open Settings -->
|
||||
<StackPanel x:Name="openSettingsOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Target" />
|
||||
<TextBox Name="OpenSettingsTarget"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for New Tab -->
|
||||
<StackPanel x:Name="newTabOptionPanel" Visibility="Collapsed" Orientation="Vertical" Margin="0,8,0,0">
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Switch To Tab -->
|
||||
<StackPanel x:Name="switchToTabOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Target" />
|
||||
<TextBox Name="switchToTabIndex"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Rename Tab -->
|
||||
<StackPanel x:Name="renameTabOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Title" />
|
||||
<TextBox Name="renameTabTextBox"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Set Tab Color -->
|
||||
<StackPanel x:Name="setTabColorOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Color" />
|
||||
<ColorPicker Name="setTabColorTextBox"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Move Focus and Resize -->
|
||||
<StackPanel x:Name="moveResizeFocusOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Direction"/>
|
||||
<ComboBox>
|
||||
<ComboBoxItem Content="Left" Tag="left"/>
|
||||
<ComboBoxItem Content="Right" Tag="right"/>
|
||||
<ComboBoxItem Content="Up" Tag="up"/>
|
||||
<ComboBoxItem Content="Down" Tag="down"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Split Pane -->
|
||||
<StackPanel x:Name="splitPaneOptionPanel" Visibility="Collapsed" Orientation="Vertical" Margin="0,8,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Split" VerticalAlignment="Center" Grid.Column="0"/>
|
||||
<ComboBox Name="SplitComboBox" HorizontalAlignment="Stretch" Grid.Column="1">
|
||||
<ComboBoxItem Content="Vertical" Tag="vertical"/>
|
||||
<ComboBoxItem Content="Horizontal" Tag="horizontal"/>
|
||||
<ComboBoxItem Content="Auto" Tag="auto"/>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Copy -->
|
||||
<StackPanel x:Name="copyOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<CheckBox x:Name="copyCheckBox" Content="Copy text as a single line" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Args for Adjust Font Size -->
|
||||
<StackPanel x:Name="adjustFontSizeOptionPanel" Visibility="Collapsed" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="Delta" />
|
||||
<TextBox Name="deltaTextBox"/>
|
||||
</StackPanel>
|
||||
|
||||
<HyperlinkButton Content="+ Add new" Click="AddNewButton_Click" Name="AddNewLink" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Keys" HorizontalAlignment="Left" Margin="0,8,0,0"/>
|
||||
<TextBox Name="KeyBindTextBox" TextChanging="KeyBindTextBox_TextChanging" Margin="0,8,0,0"/>
|
||||
|
||||
<Button Content="Save" Click="SaveButton_Click" HorizontalAlignment="Right" Margin="0,12,0,0"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Launch.h"
|
||||
#include "Launch.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Launch::Launch()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings Launch::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Launch.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Launch : LaunchT<Launch>
|
||||
{
|
||||
Launch();
|
||||
winrt::Microsoft::Terminal::Settings::Model::GlobalAppSettings GlobalSettings();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Launch);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass Launch : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Launch();
|
||||
|
||||
Microsoft.Terminal.Settings.Model.GlobalAppSettings GlobalSettings { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Launch"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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">
|
||||
<ScrollViewer>
|
||||
<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 x:Uid="Globals_Startup"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBox x:Uid="Globals_DefaultProfile" Text="{x:Bind GlobalSettings.DefaultProfile}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_StartOnUserLogin" IsChecked="{x:Bind GlobalSettings.StartOnUserLogin, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<Controls:RadioButtons x:Uid="Globals_LaunchSize" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Globals_LaunchSizeDefault" x:Name="DefaultLaunchSize"/>
|
||||
<RadioButton x:Uid="Globals_LaunchSizeMaximized" x:Name="MaximizedLaunchSize"/>
|
||||
<RadioButton x:Uid="Globals_LaunchSizeFullscreen" x:Name="FullscreenLaunchSize"/>
|
||||
</Controls:RadioButtons>
|
||||
<!--TODO: Converter here for launch position into the cols and rows number boxes-->
|
||||
<!--<TextBox x:Uid="Globals_LaunchPosition" Text="{x:Bind GlobalSettings.LaunchPosition, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse"/>
|
||||
<Controls:NumberBox x:Uid="Globals_InitialCols"
|
||||
x:Name="InitialCols"
|
||||
Value="{x:Bind GlobalSettings.InitialCols, Mode=TwoWay}"
|
||||
Margin="0,0,0,20"
|
||||
FontSize="15"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
ToolTipService.Placement="Mouse"/>
|
||||
<Controls:NumberBox x:Uid="Globals_InitialRows"
|
||||
x:Name="InitialRows"
|
||||
Value="{x:Bind GlobalSettings.InitialRows, Mode=TwoWay}"
|
||||
Margin="0,0,0,20"
|
||||
FontSize="15"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
SmallChange="10"
|
||||
LargeChange="100"
|
||||
ToolTipService.Placement="Mouse"/>-->
|
||||
</StackPanel>
|
||||
<!--TODO: Setting doesn't exist?-->
|
||||
<!--<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,100,0">
|
||||
<CheckBox x:Uid="Globals_DisableDynamicProfiles" IsChecked="{x:Bind GlobalSettings.DisableDynamicProfiles, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
</StackPanel>-->
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,297 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.h"
|
||||
#include "MainPage.g.cpp"
|
||||
#include "Home.h"
|
||||
#include "Globals.h"
|
||||
#include "Launch.h"
|
||||
#include "Interaction.h"
|
||||
#include "Rendering.h"
|
||||
#include "Profiles.h"
|
||||
#include "GlobalAppearance.h"
|
||||
#include "ColorSchemes.h"
|
||||
#include "Keybindings.h"
|
||||
#include "AddProfile.h"
|
||||
|
||||
#include <LibraryResources.h>
|
||||
|
||||
#include <winrt/Windows.Storage.h>
|
||||
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
|
||||
#include <ShlDisp.h>
|
||||
#include "../../../../../../../Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/shellapi.h"
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
namespace MUX = Microsoft::UI::Xaml;
|
||||
}
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::System;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings MainPage::_settingsSource{ nullptr };
|
||||
|
||||
MainPage::MainPage(CascadiaSettings settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// TODO GH#1564: When we actually connect this to Windows Terminal,
|
||||
// this section will clone the active AppSettings
|
||||
MainPage::_settingsSource = settings;
|
||||
_settingsClone = nullptr;
|
||||
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Add new profile"), L"AddNew_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Always show tabs"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Color scheme"), L"ColorSchemes_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Columns on first launch"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Copy after selection is made"), L"Interaction_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Copy formatting"), L"Interaction_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Default profile"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Disable dynamic profiles"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Global appearance"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Global profile settings"), L"GlobalProfile_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Hide close all tabs popup"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Interaction"), L"Interaction_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Keyboard"), L"Keyboard_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Launch"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Launch on startup"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Launch position"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Launch size"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Rendering"), L"Rendering_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Rows on first launch"), L"Launch_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Screen redrawing"), L"Rendering_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Show terminal title in title bar"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Show the title bar"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Software rendering"), L"Rendering_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Tab width mode"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Theme"), L"GlobalAppearance_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Window resize behavior"), L"Rendering_Nav"));
|
||||
SearchList.insert(std::pair<IInspectable, hstring>(Windows::Foundation::PropertyValue::CreateString(L"Word delimiters"), L"Interaction_Nav"));
|
||||
}
|
||||
|
||||
CascadiaSettings MainPage::Settings()
|
||||
{
|
||||
return _settingsSource;
|
||||
}
|
||||
|
||||
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::ContentControl>();
|
||||
const hstring homeNav = L"Home_Nav";
|
||||
const hstring itemTag = unbox_value<hstring>(item.Tag());
|
||||
|
||||
if (itemTag == homeNav)
|
||||
{
|
||||
SettingsNav().SelectedItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
contentFrame().Navigate(xaml_typename<Editor::Home>());
|
||||
}
|
||||
|
||||
void MainPage::SettingsNav_ItemInvoked(MUX::Controls::NavigationView const&, MUX::Controls::NavigationViewItemInvokedEventArgs const& args)
|
||||
{
|
||||
auto clickedItemContainer = args.InvokedItemContainer();
|
||||
|
||||
if (clickedItemContainer != NULL)
|
||||
{
|
||||
Navigate(contentFrame(), unbox_value<hstring>(clickedItemContainer.Tag()));
|
||||
}
|
||||
}
|
||||
|
||||
void MainPage::SettingsNav_BackRequested(MUX::Controls::NavigationView const&, MUX::Controls::NavigationViewBackRequestedEventArgs const& /*args*/)
|
||||
{
|
||||
On_BackRequested();
|
||||
}
|
||||
|
||||
bool MainPage::On_BackRequested()
|
||||
{
|
||||
if (!contentFrame().CanGoBack())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SettingsNav().IsPaneOpen() &&
|
||||
(SettingsNav().DisplayMode() == MUX::Controls::NavigationViewDisplayMode(1) ||
|
||||
SettingsNav().DisplayMode() == MUX::Controls::NavigationViewDisplayMode(0)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
contentFrame().GoBack();
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainPage::AutoSuggestBox_TextChanged(IInspectable const& sender, const Controls::AutoSuggestBoxTextChangedEventArgs args)
|
||||
{
|
||||
Controls::AutoSuggestBox autoBox = sender.as<Controls::AutoSuggestBox>();
|
||||
auto query = autoBox.Text();
|
||||
SearchSettings(query, autoBox);
|
||||
}
|
||||
|
||||
void MainPage::AutoSuggestBox_QuerySubmitted(const Controls::AutoSuggestBox sender, const Controls::AutoSuggestBoxQuerySubmittedEventArgs args)
|
||||
{
|
||||
auto value = args.QueryText();
|
||||
}
|
||||
|
||||
void MainPage::AutoSuggestBox_SuggestionChosen(const Controls::AutoSuggestBox sender, const Controls::AutoSuggestBoxSuggestionChosenEventArgs args)
|
||||
{
|
||||
auto selectItem = args.SelectedItem().as<Windows::Foundation::IPropertyValue>().GetString();
|
||||
Controls::AutoSuggestBox autoBox = sender.as<Controls::AutoSuggestBox>();
|
||||
|
||||
Navigate(contentFrame(), SearchList.at(args.SelectedItem()));
|
||||
}
|
||||
|
||||
void MainPage::SearchSettings(hstring query, Controls::AutoSuggestBox& autoBox)
|
||||
{
|
||||
Windows::Foundation::Collections::IVector<IInspectable> suggestions = single_threaded_vector<IInspectable>();
|
||||
std::vector<IInspectable> rawSuggestions;
|
||||
|
||||
for (auto it = SearchList.begin(); it != SearchList.end(); ++it)
|
||||
{
|
||||
auto value = it->first;
|
||||
hstring item = value.as<Windows::Foundation::IPropertyValue>().GetString();
|
||||
|
||||
std::string tmp = winrt::to_string(item);
|
||||
std::transform(tmp.begin(), tmp.end(), tmp.begin(), [](auto c) { return static_cast<char>(std::tolower(c)); });
|
||||
item = winrt::to_hstring(tmp);
|
||||
|
||||
std::string tmp2 = winrt::to_string(query);
|
||||
std::transform(tmp2.begin(), tmp2.end(), tmp2.begin(), [](auto c) { return static_cast<char>(std::tolower(c)); });
|
||||
query = winrt::to_hstring(tmp2);
|
||||
|
||||
if (std::wcsstr(item.c_str(), query.c_str()))
|
||||
{
|
||||
rawSuggestions.emplace_back(value);
|
||||
}
|
||||
}
|
||||
|
||||
// perform sort comparing strings inside of IPropertyValues
|
||||
std::sort(rawSuggestions.begin(), rawSuggestions.end(), [](const IInspectable& a, const IInspectable& b) -> bool {
|
||||
return a.as<IPropertyValue>().GetString() < b.as<IPropertyValue>().GetString();
|
||||
});
|
||||
|
||||
// Pass all elements from rawSuggestions to suggestions
|
||||
for (const auto& suggestion : rawSuggestions)
|
||||
{
|
||||
suggestions.Append(suggestion);
|
||||
}
|
||||
|
||||
autoBox.ItemsSource(suggestions);
|
||||
}
|
||||
|
||||
void MainPage::Navigate(Controls::Frame contentFrame, hstring clickedItemTag)
|
||||
{
|
||||
const hstring homePage = L"Home_Nav";
|
||||
const hstring generalPage = L"General_Nav";
|
||||
const hstring launchSubpage = L"Launch_Nav";
|
||||
const hstring interactionSubpage = L"Interaction_Nav";
|
||||
const hstring renderingSubpage = L"Rendering_Nav";
|
||||
|
||||
const hstring profilesPage = L"Profiles_Nav";
|
||||
const hstring globalProfileSubpage = L"GlobalProfile_Nav";
|
||||
const hstring addNewSubpage = L"AddNew_Nav";
|
||||
|
||||
const hstring appearancePage = L"Appearance_Nav";
|
||||
const hstring colorSchemesPage = L"ColorSchemes_Nav";
|
||||
const hstring globalAppearancePage = L"GlobalAppearance_Nav";
|
||||
|
||||
const hstring keybindingsPage = L"Keyboard_Nav";
|
||||
const hstring openJSON = L"OpenJSON_Nav";
|
||||
|
||||
if (clickedItemTag == homePage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Home>());
|
||||
}
|
||||
else if (clickedItemTag == launchSubpage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Launch>());
|
||||
}
|
||||
else if (clickedItemTag == interactionSubpage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Interaction>());
|
||||
}
|
||||
else if (clickedItemTag == renderingSubpage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Rendering>());
|
||||
}
|
||||
else if (clickedItemTag == globalProfileSubpage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Profiles>());
|
||||
}
|
||||
else if (clickedItemTag == addNewSubpage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::AddProfile>());
|
||||
}
|
||||
else if (clickedItemTag == colorSchemesPage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::ColorSchemes>());
|
||||
}
|
||||
else if (clickedItemTag == globalAppearancePage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::GlobalAppearance>());
|
||||
}
|
||||
else if (clickedItemTag == keybindingsPage)
|
||||
{
|
||||
contentFrame.Navigate(xaml_typename<Editor::Keybindings>());
|
||||
}
|
||||
else if (clickedItemTag == openJSON)
|
||||
{
|
||||
_OpenJSONOnClick();
|
||||
}
|
||||
}
|
||||
|
||||
void MainPage::_OpenJSONOnClick()
|
||||
{
|
||||
/*const CoreWindow window = CoreWindow::GetForCurrentThread();
|
||||
const auto rAltState = window.GetKeyState(VirtualKey::RightMenu);
|
||||
const auto lAltState = window.GetKeyState(VirtualKey::LeftMenu);*/
|
||||
/*const bool altPressed = WI_IsFlagSet(lAltState, CoreVirtualKeyStates::Down) ||
|
||||
WI_IsFlagSet(rAltState, CoreVirtualKeyStates::Down);
|
||||
|
||||
const auto target = altPressed ? SettingsTarget::DefaultsFile : SettingsTarget::SettingsFile;*/
|
||||
const auto target = SettingsTarget::SettingsFile;
|
||||
_LaunchSettings(target);
|
||||
}
|
||||
|
||||
fire_and_forget MainPage::_LaunchSettings(const SettingsTarget target)
|
||||
{
|
||||
// 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 openFile = [](const auto& filePath) {
|
||||
HINSTANCE res = ShellExecute(nullptr, nullptr, filePath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
|
||||
{
|
||||
ShellExecute(nullptr, nullptr, L"notepad", filePath.c_str(), nullptr, SW_SHOW);
|
||||
}
|
||||
};
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case SettingsTarget::DefaultsFile:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
break;
|
||||
case SettingsTarget::SettingsFile:
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
case SettingsTarget::AllFiles:
|
||||
openFile(CascadiaSettings::DefaultSettingsPath());
|
||||
openFile(CascadiaSettings::SettingsPath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Utils.h"
|
||||
#include "MainPage.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct MainPage : MainPageT<MainPage>
|
||||
{
|
||||
MainPage() = delete;
|
||||
MainPage(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
|
||||
|
||||
void SettingsNav_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
|
||||
void SettingsNav_ItemInvoked(Microsoft::UI::Xaml::Controls::NavigationView const& sender, Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs const& args);
|
||||
void SettingsNav_BackRequested(Microsoft::UI::Xaml::Controls::NavigationView const&, Microsoft::UI::Xaml::Controls::NavigationViewBackRequestedEventArgs const& args);
|
||||
bool On_BackRequested();
|
||||
static void Navigate(Windows::UI::Xaml::Controls::Frame contentFrame, hstring clickedItemTag);
|
||||
|
||||
std::map<IInspectable, hstring> SearchList;
|
||||
|
||||
void AutoSuggestBox_TextChanged(Windows::Foundation::IInspectable const& sender, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs args);
|
||||
void AutoSuggestBox_QuerySubmitted(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox sender, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs args);
|
||||
void AutoSuggestBox_SuggestionChosen(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox sender, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs args);
|
||||
void SearchSettings(hstring query, winrt::Windows::UI::Xaml::Controls::AutoSuggestBox& autoBox);
|
||||
static winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings Settings();
|
||||
|
||||
private:
|
||||
// XAML should data-bind to the _settingsClone
|
||||
// When "save" is pressed, _settingsSource = _settingsClone
|
||||
static winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings _settingsSource;
|
||||
winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings _settingsClone{ nullptr };
|
||||
|
||||
static void _OpenJSONOnClick();
|
||||
static fire_and_forget _LaunchSettings(const Microsoft::Terminal::Settings::Model::SettingsTarget target);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(MainPage);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface]
|
||||
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
MainPage(Microsoft.Terminal.Settings.Model.CascadiaSettings settings);
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.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.Editor"
|
||||
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">
|
||||
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<AcrylicBrush x:Key="NavigationViewDefaultPaneBackground"
|
||||
BackgroundSource="Backdrop" TintColor="{ThemeResource SystemChromeMediumColor}" TintOpacity=".5"/>
|
||||
<AcrylicBrush x:Key="NavigationViewTopPaneBackground"
|
||||
BackgroundSource="Backdrop" TintColor="{ThemeResource SystemChromeMediumColor}" TintOpacity=".5"/>
|
||||
<AcrylicBrush x:Key="NavigationViewExpandedPaneBackground"
|
||||
BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeMediumColor}" TintOpacity=".7"/>
|
||||
</Grid.Resources>
|
||||
<muxc:NavigationView x:Name="SettingsNav"
|
||||
IsSettingsVisible="False"
|
||||
Loaded="SettingsNav_Loaded"
|
||||
ItemInvoked="SettingsNav_ItemInvoked"
|
||||
IsBackButtonVisible="Auto"
|
||||
IsBackEnabled="True"
|
||||
BackRequested="SettingsNav_BackRequested">
|
||||
<muxc:NavigationView.AutoSuggestBox>
|
||||
<AutoSuggestBox PlaceholderText="Search"
|
||||
QueryIcon="Find"
|
||||
TextChanged="AutoSuggestBox_TextChanged"
|
||||
QuerySubmitted="AutoSuggestBox_QuerySubmitted"
|
||||
SuggestionChosen="AutoSuggestBox_SuggestionChosen"/>
|
||||
</muxc:NavigationView.AutoSuggestBox>
|
||||
<muxc:NavigationView.MenuItems>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Home"
|
||||
Icon="Home"
|
||||
Tag="Home_Nav"/>
|
||||
<muxc:NavigationViewItem x:Uid="Nav_General"
|
||||
Icon="Globe"
|
||||
Tag="General_Nav">
|
||||
<muxc:NavigationViewItem.MenuItems>
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Launch"
|
||||
Tag="Launch_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Interaction"
|
||||
Tag="Interaction_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Rendering"
|
||||
Tag="Rendering_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
</muxc:NavigationViewItem.MenuItems>
|
||||
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Appearance" Tag="Appearance_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
|
||||
<muxc:NavigationViewItem.MenuItems>
|
||||
<muxc:NavigationViewItem x:Uid="Nav_AppearanceGlobal"
|
||||
Tag="GlobalAppearance_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_ColorSchemes"
|
||||
Tag="ColorSchemes_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
</muxc:NavigationViewItem.MenuItems>
|
||||
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_Profiles"
|
||||
Tag="Profiles_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
|
||||
<muxc:NavigationViewItem.MenuItems>
|
||||
<muxc:NavigationViewItem x:Uid="Nav_ProfileGlobal"
|
||||
Tag="GlobalProfile_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem Tag="CmdPrompt_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock Tag="CmdPrompt_Page">Command Prompt</TextBlock>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem Tag="Powershell_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock Tag="Powershell_Page">Windows Powershell</TextBlock>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem Tag="Ubuntu_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock Tag="Ubuntu_Page">Ubuntu</TextBlock>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem Tag="Powershell7_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
<TextBlock Tag="Powershell7_Page">PowerShell 7</TextBlock>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
<muxc:NavigationViewItem x:Uid="Nav_AddNewProfile"
|
||||
Tag="AddNew_Nav" >
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
</muxc:NavigationViewItem.MenuItems>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
|
||||
<muxc:NavigationViewItem Icon="Keyboard"
|
||||
Tag="Keyboard_Nav">
|
||||
<TextBlock Tag="Keyboard_Page">Keyboard</TextBlock>
|
||||
</muxc:NavigationViewItem>
|
||||
|
||||
</muxc:NavigationView.MenuItems>
|
||||
<muxc:NavigationView.PaneFooter>
|
||||
<muxc:NavigationViewItem x:Uid="Nav_OpenJSON"
|
||||
Tag="OpenJSON_Nav">
|
||||
<muxc:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</muxc:NavigationViewItem.Icon>
|
||||
</muxc:NavigationViewItem>
|
||||
</muxc:NavigationView.PaneFooter>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Frame x:Name="contentFrame"
|
||||
Margin="20"
|
||||
Grid.Row="0"></Frame>
|
||||
<Grid Height="100" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="200"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Uid="Settings_UnsavedSettingsWarning" Grid.Column="0" Foreground="Goldenrod" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" TextAlignment="Left" Margin="30,0,0,0"/>
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,0,30,0">
|
||||
<Button x:Uid="Settings_ResetSettingsButton" FontSize="15" ToolTipService.Placement="Mouse"/>
|
||||
<Button x:Uid="Settings_SaveSettingsButton" FontSize="15" Style="{StaticResource AccentButtonStyle}" Margin="10,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</muxc:NavigationView>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,3 +0,0 @@
|
||||
EXPORTS
|
||||
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
|
||||
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
|
||||
@@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="HomeGridItem.cpp" />
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
<ClCompile Include="Utils.cpp" />
|
||||
<ClCompile Include="ObjectModel\ColorSchemeModel.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ObjectModel\ColorScheme.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ObjectModel\AppSettings.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ObjectModel\GlobalSettings.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ObjectModel\GlobalSettingsModel.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ObjectModel\Profile.cpp">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="HomeGridItem.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Utils.h" />
|
||||
<ClInclude Include="ObjectModel\ColorSchemeModel.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ObjectModel\ColorScheme.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ObjectModel\AppSettings.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ObjectModel\GlobalSettings.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ObjectModel\GlobalSettingsModel.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ObjectModel\Profile.h">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="HomeGridItem.idl" />
|
||||
<Midl Include="ObjectModel\ColorSchemeModel.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ObjectModel\ColorScheme.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ObjectModel\GlobalSettings.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ObjectModel\GlobalSettingsModel.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ObjectModel\Profile.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="ObjectModel\ProfileModel.idl">
|
||||
<Filter>ObjectModel</Filter>
|
||||
</Midl>
|
||||
<Midl Include="SettingsEditorViewModel.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="TerminalSettingsEditor.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="AddProfile.xaml" />
|
||||
<Page Include="GlobalAppearance.xaml" />
|
||||
<Page Include="ColorSchemes.xaml" />
|
||||
<Page Include="Globals.xaml" />
|
||||
<Page Include="Home.xaml" />
|
||||
<Page Include="Interaction.xaml" />
|
||||
<Page Include="Keybindings.xaml" />
|
||||
<Page Include="Launch.xaml" />
|
||||
<Page Include="MainPage.xaml" />
|
||||
<Page Include="SplitPaneOptionPanelControl.xaml" />
|
||||
<Page Include="NewTabOptionPanelControl.xaml" />
|
||||
<Page Include="Profiles.xaml" />
|
||||
<Page Include="Rendering.xaml" />
|
||||
<Page Include="CommonResources.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="ObjectModel">
|
||||
<UniqueIdentifier>{46598618-8219-4016-ae77-cb53d953645a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,292 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!--
|
||||
We're explicitly telling our references to be non-private so that they won't
|
||||
be copied into our folder. In the case of Microsoft.Ui.Xaml, it seems to copy
|
||||
literally everything EXCEPT its .winmd file, which allows us to keep building.
|
||||
-->
|
||||
<ItemDefinitionGroup>
|
||||
<Reference>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CA5CAD1A-0b5e-45c3-96a8-bb496bfe4e32}</ProjectGuid>
|
||||
<ProjectName>Microsoft.Terminal.Settings.Editor</ProjectName>
|
||||
<RootNamespace>Microsoft.Terminal.Settings.Editor</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.TerminalControl 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>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
<!-- ========================= Headers ======================== -->
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AddProfile.h">
|
||||
<DependentUpon>AddProfile.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ColorToHexConverter.h">
|
||||
<DependentUpon>ColorToHexConverter.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GlobalAppearance.h">
|
||||
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ColorSchemes.h">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Globals.h">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Home.h">
|
||||
<DependentUpon>Home.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HomeGridItem.h">
|
||||
<DependentUpon>HomeGridItem.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Interaction.h">
|
||||
<DependentUpon>Interaction.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Keybindings.h">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Launch.h">
|
||||
<DependentUpon>Launch.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SplitPaneOptionPanelControl.h">
|
||||
<DependentUpon>SplitPaneOptionPanelControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="NewTabOptionPanelControl.h">
|
||||
<DependentUpon>NewTabOptionPanelControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="MainPage.h">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Profiles.h">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Rendering.h">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Utils.h" />
|
||||
<ClInclude Include="SettingsEditorViewModel.h">
|
||||
<DependentUpon>SettingsEditorViewModel.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<!-- ========================= XAML files ======================== -->
|
||||
<ItemGroup>
|
||||
<Page Include="AddProfile.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="CommonResources.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="GlobalAppearance.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ColorSchemes.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Globals.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Home.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Interaction.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Keybindings.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Launch.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SplitPaneOptionPanelControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="NewTabOptionPanelControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Profiles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Rendering.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<!-- ========================= Cpp Files ======================== -->
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AddProfile.cpp">
|
||||
<DependentUpon>AddProfile.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ColorToHexConverter.cpp">
|
||||
<DependentUpon>ColorToHexConverter.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GlobalAppearance.cpp">
|
||||
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ColorSchemes.cpp">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Globals.cpp">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Home.cpp">
|
||||
<DependentUpon>Home.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HomeGridItem.cpp">
|
||||
<DependentUpon>HomeGridItem.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Interaction.cpp">
|
||||
<DependentUpon>Interaction.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Keybindings.cpp">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Launch.cpp">
|
||||
<DependentUpon>Launch.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SplitPaneOptionPanelControl.cpp">
|
||||
<DependentUpon>SplitPaneOptionPanelControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="NewTabOptionPanelControl.cpp">
|
||||
<DependentUpon>NewTabOptionPanelControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MainPage.cpp">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
||||
<ClCompile Include="Profiles.cpp">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Rendering.cpp">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Utils.cpp" />
|
||||
<ClCompile Include="SettingsEditorViewModel.cpp">
|
||||
<DependentUpon>SettingsEditorViewModel.idl</DependentUpon>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<!-- ========================= idl Files ======================== -->
|
||||
<ItemGroup>
|
||||
<Midl Include="ColorToHexConverter.idl" />
|
||||
<Midl Include="Home.idl">
|
||||
<DependentUpon>Home.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="GlobalAppearance.idl">
|
||||
<DependentUpon>GlobalAppearance.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="ColorSchemes.idl">
|
||||
<DependentUpon>ColorSchemes.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="Globals.idl">
|
||||
<DependentUpon>Globals.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="HomeGridItem.idl" />
|
||||
<Midl Include="Launch.idl">
|
||||
<DependentUpon>Launch.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="Interaction.idl">
|
||||
<DependentUpon>Interaction.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="Rendering.idl">
|
||||
<DependentUpon>Rendering.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="Keybindings.idl">
|
||||
<DependentUpon>Keybindings.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="MainPage.idl">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Midl>
|
||||
<Midl Include="Profiles.idl">
|
||||
<DependentUpon>Profiles.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="AddProfile.idl">
|
||||
<DependentUpon>AddProfile.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="SplitPaneOptionPanelControl.idl">
|
||||
<DependentUpon>SplitPaneOptionPanelControl.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="NewTabOptionPanelControl.idl">
|
||||
<DependentUpon>NewTabOptionPanelControl.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Midl>
|
||||
<Midl Include="SettingsEditorViewModel.idl" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
<ItemGroup>
|
||||
<None Include="TerminalSettingsEditor.def" />
|
||||
<None Include="packages.config" />
|
||||
<PRIResource Include="Resources\en-US\Resources.resw" />
|
||||
<OCResourceDirectory Include="Resources" />
|
||||
<None Include="PropertySheet.props" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Project References ======================== -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.200609001\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.200609001\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('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.200609001\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.200609001\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
</Target>
|
||||
|
||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||
</Project>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "NewTabOptionPanelControl.h"
|
||||
#include "NewTabOptionPanelControl.g.cpp"
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace winrt::Windows::UI::Xaml::Data;
|
||||
using namespace winrt::Windows::UI::Xaml::Input;
|
||||
using namespace winrt::Windows::UI::Xaml::Media;
|
||||
using namespace winrt::Windows::UI::Xaml::Navigation;
|
||||
using namespace winrt::Microsoft::Terminal::Settings;
|
||||
|
||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
NewTabOptionPanelControl::NewTabOptionPanelControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
argumentComboBox = FindName(c_argumentComboBoxName).as<Controls::ComboBox>();
|
||||
argumentInputTextBox = FindName(c_textBoxName).as<Controls::TextBox>();
|
||||
}
|
||||
|
||||
hstring NewTabOptionPanelControl::Argument()
|
||||
{
|
||||
return GetSelectedItemTag(argumentComboBox);
|
||||
}
|
||||
|
||||
hstring NewTabOptionPanelControl::InputValue()
|
||||
{
|
||||
return argumentInputTextBox.Text();
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "NewTabOptionPanelControl.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct NewTabOptionPanelControl : NewTabOptionPanelControlT<NewTabOptionPanelControl>
|
||||
{
|
||||
NewTabOptionPanelControl();
|
||||
|
||||
hstring Argument();
|
||||
hstring InputValue();
|
||||
|
||||
private:
|
||||
const hstring c_argumentComboBoxName = L"newTabArgumentComboBox";
|
||||
const hstring c_textBoxName = L"newTabTextBox";
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::ComboBox argumentComboBox;
|
||||
winrt::Windows::UI::Xaml::Controls::TextBox argumentInputTextBox;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(NewTabOptionPanelControl);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass NewTabOptionPanelControl : Windows.UI.Xaml.Controls.UserControl
|
||||
{
|
||||
NewTabOptionPanelControl();
|
||||
|
||||
String Argument { get; };
|
||||
String InputValue { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<UserControl
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.NewTabOptionPanelControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="0,8,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ComboBox Name="newTabArgumentComboBox" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" >
|
||||
<ComboBoxItem Content="CommandLine" Tag="commandLine"/>
|
||||
<ComboBoxItem Content="Starting Directory" Tag="startingDirectory"/>
|
||||
<ComboBoxItem Content="Tab Title" Tag="tabTitle"/>
|
||||
<ComboBoxItem Content="Index" Tag="index"/>
|
||||
<ComboBoxItem Content="Profile" Tag="profile"/>
|
||||
</ComboBox>
|
||||
<TextBox Name="newTabTextBox" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,77 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Profiles.h"
|
||||
#include "Profiles.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Storage;
|
||||
using namespace winrt::Windows::Storage::AccessCache;
|
||||
using namespace winrt::Windows::Storage::Pickers;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Profiles::Profiles()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Profiles::Profiles(Settings::Model::Profile profile)
|
||||
{
|
||||
InitializeComponent();
|
||||
Profile(profile);
|
||||
}
|
||||
|
||||
fire_and_forget Profiles::BackgroundImage_Click(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
auto lifetime = get_strong();
|
||||
|
||||
FileOpenPicker picker;
|
||||
|
||||
picker.ViewMode(PickerViewMode::Thumbnail);
|
||||
picker.SuggestedStartLocation(PickerLocationId::PicturesLibrary);
|
||||
picker.FileTypeFilter().ReplaceAll({ L".jpg", L".jpeg", L".png", L".gif" });
|
||||
|
||||
StorageFile file = co_await picker.PickSingleFileAsync();
|
||||
if (file != nullptr)
|
||||
{
|
||||
BackgroundImage().Text(file.Path());
|
||||
}
|
||||
}
|
||||
|
||||
fire_and_forget Profiles::Commandline_Click(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
auto lifetime = get_strong();
|
||||
|
||||
FileOpenPicker picker;
|
||||
|
||||
//TODO: SETTINGS UI Commandline handling should be robust and intelligent
|
||||
picker.ViewMode(PickerViewMode::Thumbnail);
|
||||
picker.SuggestedStartLocation(PickerLocationId::ComputerFolder);
|
||||
picker.FileTypeFilter().ReplaceAll({ L".bat", L".exe" });
|
||||
|
||||
StorageFile file = co_await picker.PickSingleFileAsync();
|
||||
if (file != nullptr)
|
||||
{
|
||||
Commandline().Text(file.Path());
|
||||
}
|
||||
}
|
||||
|
||||
// TODO GH#1564: Settings UI
|
||||
// This crashes on click, for some reason
|
||||
/*
|
||||
fire_and_forget Profiles::StartingDirectory_Click(IInspectable const&, RoutedEventArgs const&)
|
||||
{
|
||||
auto lifetime = get_strong();
|
||||
FolderPicker picker;
|
||||
picker.SuggestedStartLocation(PickerLocationId::DocumentsLibrary);
|
||||
StorageFolder folder = co_await picker.PickSingleFolderAsync();
|
||||
if (folder != nullptr)
|
||||
{
|
||||
StorageApplicationPermissions::FutureAccessList().AddOrReplace(L"PickedFolderToken", folder);
|
||||
StartingDirectory().Text(folder.Path());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Utils.h"
|
||||
#include "Profiles.g.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Profiles : ProfilesT<Profiles>
|
||||
{
|
||||
public:
|
||||
Profiles();
|
||||
Profiles(winrt::Microsoft::Terminal::Settings::Model::Profile profile);
|
||||
|
||||
fire_and_forget BackgroundImage_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
fire_and_forget Commandline_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
// TODO GH#1564: Settings UI
|
||||
// This crashes on click, for some reason
|
||||
//fire_and_forget StartingDirectory_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
|
||||
|
||||
GETSET_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::Profile, Profile);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Profiles);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass Profiles : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Profiles();
|
||||
Microsoft.Terminal.Settings.Model.Profile Profile { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,266 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.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.Editor"
|
||||
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"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<!--TODO: Don't be like me and put a whole control in resources bc it's shared.
|
||||
Find a different way to dedupe the buttons/flyouts. -->
|
||||
<!--<Flyout x:Key="ColorPickerFlyout">
|
||||
<ColorPicker IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True" />
|
||||
</Flyout>-->
|
||||
</Page.Resources>
|
||||
<ScrollViewer>
|
||||
<Pivot>
|
||||
<PivotItem x:Uid="Profile_General">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Uid="Profile_Commandline" x:Name="Commandline" Margin="0,0,0,20" Grid.Row="0" Grid.Column="0" FontSize="15" Text="{x:Bind Profile.Commandline, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Button x:Uid="Profile_CommandlineBrowse" Click="Commandline_Click" Margin="5,0,0,0" Grid.Row="0" Grid.Column="1" FontSize="15"/>
|
||||
<TextBox x:Uid="Profile_StartingDirectory" x:Name="StartingDirectory" Margin="0,0,0,20" Grid.Row="1" Grid.Column="0" FontSize="15" Text="{x:Bind Profile.StartingDirectory, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Button x:Uid="Profile_StartingDirectoryBrowse" Margin="5,0,0,0" Grid.Row="1" Grid.Column="1" FontSize="15"/>
|
||||
<TextBox x:Uid="Profile_Icon" Margin="0,0,0,20" Grid.Row="2" Grid.Column="0" FontSize="15" Text="{x:Bind Profile.Icon, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Button x:Uid="Profile_IconBrowse" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1" FontSize="15" />
|
||||
<StackPanel Grid.Row="3" Grid.Column="0">
|
||||
<TextBox x:Uid="Profile_TabTitle" Margin="0,0,0,20" FontSize="15" Text="{x:Bind Profile.TabTitle, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Controls:RadioButtons x:Uid="Profile_ScrollbarVisibility" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Profile_ScrollbarVisibilityVisible" x:Name="ScrollBarVisible"/>
|
||||
<RadioButton x:Uid="Profile_ScrollbarVisibilityHidden" x:Name="ScrollBarHidden"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
<PivotItem x:Uid="Profile_Appearance">
|
||||
<ScrollViewer>
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="0,12,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- THIS IS WHERE THE MINI-TERMINAL WOULD GO -->
|
||||
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Margin="0,0,100,0">
|
||||
<TextBox x:Uid="Profile_FontFace" Margin="0,0,0,20" FontSize="15" Text="{x:Bind Profile.FontFace, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="0" Grid.Row="1" Margin="0,0,100,0">
|
||||
<Controls:NumberBox x:Uid="Profile_FontSize" Margin="0,0,0,20" FontSize="15" Value="{x:Bind Profile.FontSize, Mode=TwoWay}" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" ToolTipService.Placement="Mouse" />
|
||||
<TextBox x:Uid="Profile_FontWeight" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse"/>
|
||||
<TextBox x:Uid="Profile_Padding" Margin="0,0,0,20" FontSize="15" Text="{x:Bind Profile.Padding, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Controls:RadioButtons x:Uid="Profile_CursorShape" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Profile_CursorShapeBar" x:Name="CursorShapeBar"/>
|
||||
<RadioButton x:Uid="Profile_CursorShapeVintage" x:Name="CursorShapeVintage"/>
|
||||
<RadioButton x:Uid="Profile_CursorShapeUnderscore" x:Name="CursorShapeUnderscore"/>
|
||||
<RadioButton x:Uid="Profile_CursorShapeFilledBox" x:Name="CursorShapeFilledBox"/>
|
||||
<RadioButton x:Uid="Profile_CursorShapeEmptyBox" x:Name="CursorShapeEmptyBox"/>
|
||||
</Controls:RadioButtons>
|
||||
<Controls:NumberBox x:Uid="Profile_CursorHeight" Margin="0,0,0,20" FontSize="15" Value="100" SpinButtonPlacementMode="Compact" SmallChange="1" LargeChange="10" ToolTipService.Placement="Mouse" />
|
||||
<StackPanel x:Uid="Profile_CursorColorToolTip"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,0,0,20"
|
||||
ToolTipService.Placement="Mouse">
|
||||
<TextBox x:Uid="Profile_CursorColor"
|
||||
FontSize="15"
|
||||
Text="#FFFFFF" />
|
||||
<Button Background="White"
|
||||
BorderBrush="{StaticResource SystemBaseLowColor}"
|
||||
Height="37"
|
||||
Width="37"
|
||||
Margin="10,22,0,0"
|
||||
CornerRadius="2">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True" />
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DropDownButton x:Uid="Profile_ColorScheme" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="Campbell"/>
|
||||
<MenuFlyoutItem Text="Campbell Powershell"/>
|
||||
<MenuFlyoutItem Text="Vintage"/>
|
||||
<MenuFlyoutItem Text="One Half Dark"/>
|
||||
<MenuFlyoutItem Text="One Half Light"/>
|
||||
<MenuFlyoutItem Text="Tango Dark"/>
|
||||
<MenuFlyoutItem Text="Tango Light"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<StackPanel x:Uid="Profile_ForegroundColorToolTip"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,0,0,20"
|
||||
ToolTipService.Placement="Mouse">
|
||||
<TextBox x:Uid="Profile_ForegroundColor"
|
||||
FontSize="15"
|
||||
Text="#FFFFFF" />
|
||||
<Button Background="White"
|
||||
BorderBrush="{StaticResource SystemBaseLowColor}"
|
||||
Height="37"
|
||||
Width="37"
|
||||
Margin="10,22,0,0"
|
||||
CornerRadius="2">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True" />
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel x:Uid="Profile_BackgroundColorToolTip"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,0,0,20"
|
||||
ToolTipService.Placement="Mouse">
|
||||
<TextBox x:Uid="Profile_BackgroundColor"
|
||||
FontSize="15"
|
||||
Text="#000000" />
|
||||
<Button Background="Black"
|
||||
BorderBrush="{StaticResource SystemBaseLowColor}"
|
||||
Height="37"
|
||||
Width="37"
|
||||
Margin="10,22,0,0"
|
||||
CornerRadius="2">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True" />
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel x:Uid="Profile_SelectionBackgroundColorToolTip"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,0,0,20"
|
||||
ToolTipService.Placement="Mouse">
|
||||
<TextBox x:Uid="Profile_SelectionBackgroundColor"
|
||||
FontSize="15"
|
||||
Text="#808080" />
|
||||
<Button Background="Gray"
|
||||
BorderBrush="{StaticResource SystemBaseLowColor}"
|
||||
Height="37"
|
||||
Width="37"
|
||||
Margin="10,22,0,0"
|
||||
CornerRadius="2">
|
||||
<Button.Flyout>
|
||||
<Flyout>
|
||||
<ColorPicker IsColorSliderVisible="False"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="True"
|
||||
IsAlphaTextInputVisible="True" />
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<TextBox x:Uid="Profile_BackgroundImage" x:Name="BackgroundImage" Margin="0,0,0,20" FontSize="15" Grid.Column="1" Grid.Row="0" Text="{x:Bind Profile.BackgroundImagePath, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Button x:Uid="Profile_BackgroundImageBrowse" Click="BackgroundImage_Click" Margin="5,0,0,0" Grid.Column="2" Grid.Row="0"/>
|
||||
<StackPanel Grid.Column="1" Grid.Row="1" Margin="0,0,100,0">
|
||||
<Controls:RadioButtons x:Uid="Profile_BackgroundImageStretchMode" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Profile_BackgroundImageStretchModeNone" x:Name="backgroundImageStretchModeNone"/>
|
||||
<RadioButton x:Uid="Profile_BackgroundImageStretchModeFill" x:Name="backgroundImageStretchModeFill"/>
|
||||
<RadioButton x:Uid="Profile_BackgroundImageStretchModeUniform" x:Name="backgroundImageStretchModeUniform"/>
|
||||
<RadioButton x:Uid="Profile_BackgroundImageStretchModeUniformToFill" x:Name="backgroundImageStretchModeUniformToFill"/>
|
||||
</Controls:RadioButtons>
|
||||
<DropDownButton x:Uid="Profile_BackgroundImageAlignment" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentCenter"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentLeft"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentTop"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentRight"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentBottom"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentTopLeft"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentTopRight"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentBottomLeft"/>
|
||||
<MenuFlyoutItem x:Uid="Profile_BackgroundImageAlignmentBottomRight"/>
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<Controls:NumberBox x:Uid="Profile_BackgroundImageOpacity" Margin="0,0,0,20" FontSize="15" Value="{x:Bind Profile.BackgroundImageOpacity, Mode=TwoWay}" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="25" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Profile_UseAcrylic" Margin="0,0,0,20" FontSize="15" IsChecked="{x:Bind Profile.UseAcrylic, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
<Controls:NumberBox x:Uid="Profile_AcrylicOpacity" Margin="0,0,0,20" FontSize="15" Value="{x:Bind Profile.AcrylicOpacity, Mode=TwoWay}" SpinButtonPlacementMode="Compact" SmallChange="0.1" LargeChange="0.25" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Profile_RetroTerminalEffect" Margin="0,0,0,20" FontSize="15" IsChecked="{x:Bind Profile.RetroTerminalEffect, Mode=TwoWay}" ToolTipService.Placement="Mouse"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
<PivotItem x:Uid="Profile_Advanced">
|
||||
<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>
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<CheckBox x:Uid="Profile_Hidden" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Profile_SuppressApplicationTitle" ToolTipService.Placement="Mouse" />
|
||||
<Controls:RadioButtons x:Uid="Profile_AntialiasingMode" Margin="0,0,0,10" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Profile_AntialiasingModeGrayscale" x:Name="antialiasingTextGrayscale"/>
|
||||
<RadioButton x:Uid="Profile_AntialiasingModeClearType" x:Name="antialiasingTextClearType"/>
|
||||
<RadioButton x:Uid="Profile_AntialiasingModeAliased" x:Name="antialiasingTextAliased"/>
|
||||
</Controls:RadioButtons>
|
||||
<CheckBox x:Uid="Profile_AltGrAliasing" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Profile_SnapOnInput" ToolTipService.Placement="Mouse" />
|
||||
<Controls:NumberBox x:Uid="Profile_HistorySize" Margin="0,0,0,10" Value="9001" SpinButtonPlacementMode="Compact" SmallChange="10" LargeChange="100" ToolTipService.Placement="Mouse" />
|
||||
<Controls:RadioButtons x:Uid="Profile_CloseOnExit" Margin="0,0,0,10" ToolTipService.Placement="Mouse">
|
||||
<RadioButton x:Uid="Profile_CloseOnExitGraceful" x:Name="closeOnExitGraceful"/>
|
||||
<RadioButton x:Uid="Profile_CloseOnExitAlways" x:Name="closeOnExitAlways"/>
|
||||
<RadioButton x:Uid="Profile_CloseOnExitNever" x:Name="closeOnExitNever"/>
|
||||
</Controls:RadioButtons>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "Rendering.h"
|
||||
#include "Rendering.g.cpp"
|
||||
#include "MainPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
Rendering::Rendering()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
GlobalAppSettings Rendering::GlobalSettings()
|
||||
{
|
||||
return MainPage::Settings().GlobalSettings();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Rendering.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct Rendering : RenderingT<Rendering>
|
||||
{
|
||||
Rendering();
|
||||
winrt::Microsoft::Terminal::Settings::Model::GlobalAppSettings GlobalSettings();
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(Rendering);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
[default_interface] runtimeclass Rendering : Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
Rendering();
|
||||
Microsoft.Terminal.Settings.Model.GlobalAppSettings GlobalSettings { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information. -->
|
||||
<Page
|
||||
x:Class="Microsoft.Terminal.Settings.Editor.Rendering"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
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">
|
||||
<ScrollViewer>
|
||||
<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 x:Uid="Globals_Rendering"
|
||||
Style="{StaticResource SubheaderTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
|
||||
<TextBlock x:Uid="Globals_RenderingDisclaimer"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Margin="0,0,0,20" />
|
||||
<CheckBox x:Uid="Globals_ForceFullRepaint" IsChecked="{x:Bind GlobalSettings.ForceFullRepaintRendering, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
<CheckBox x:Uid="Globals_SoftwareRendering" IsChecked="{x:Bind GlobalSettings.SoftwareRendering, Mode=TwoWay}" Margin="0,0,0,20" FontSize="15" ToolTipService.Placement="Mouse" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,664 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ColorScheme_Background.Header" xml:space="preserve">
|
||||
<value>Background</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Black.Header" xml:space="preserve">
|
||||
<value>Black</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Blue.Header" xml:space="preserve">
|
||||
<value>Blue</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightBlack.Header" xml:space="preserve">
|
||||
<value>Bright black</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightBlue.Header" xml:space="preserve">
|
||||
<value>Bright blue</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightCyan.Header" xml:space="preserve">
|
||||
<value>Bright cyan</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightGreen.Header" xml:space="preserve">
|
||||
<value>Bright green</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightPurple.Header" xml:space="preserve">
|
||||
<value>Bright purple</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightRed.Header" xml:space="preserve">
|
||||
<value>Bright red</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightWhite.Header" xml:space="preserve">
|
||||
<value>Bright white</value>
|
||||
</data>
|
||||
<data name="ColorScheme_BrightYellow.Header" xml:space="preserve">
|
||||
<value>Bright yellow</value>
|
||||
</data>
|
||||
<data name="ColorScheme_ColorSchemes.Text" xml:space="preserve">
|
||||
<value>Color schemes</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Cyan.Header" xml:space="preserve">
|
||||
<value>Cyan</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Foreground.Header" xml:space="preserve">
|
||||
<value>Foreground</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Green.Header" xml:space="preserve">
|
||||
<value>Green</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Purple.Header" xml:space="preserve">
|
||||
<value>Purple</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Red.Header" xml:space="preserve">
|
||||
<value>Red</value>
|
||||
</data>
|
||||
<data name="ColorScheme_White.Header" xml:space="preserve">
|
||||
<value>White</value>
|
||||
</data>
|
||||
<data name="ColorScheme_Yellow.Header" xml:space="preserve">
|
||||
<value>Yellow</value>
|
||||
</data>
|
||||
<data name="Globals_AlwaysShowTabs.Content" xml:space="preserve">
|
||||
<value>Always show tabs</value>
|
||||
</data>
|
||||
<data name="Globals_AlwaysShowTabs.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, tabs are always displayed. When unchecked and 'show the title bar' is checked, tabs only appear after opening a new tab.</value>
|
||||
<comment>'show the title bar' must match the value for <Globals_ShowTitlebar.Content>.</comment>
|
||||
</data>
|
||||
<data name="Globals_ConfirmCloseAllTabs.Content" xml:space="preserve">
|
||||
<value>Show close all tabs popup</value>
|
||||
</data>
|
||||
<data name="Globals_ConfirmCloseAllTabs.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, closing a window with multiple tabs open will require confirmation. When unchecked, the confirmation dialog will not appear.</value>
|
||||
</data>
|
||||
<data name="Globals_CopyFormatting.Content" xml:space="preserve">
|
||||
<value>Copy formatting</value>
|
||||
</data>
|
||||
<data name="Globals_CopyFormatting.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the color and font formatting of selected text is also copied to your clipboard. When unchecked, only plain text is copied to your clipboard.</value>
|
||||
</data>
|
||||
<data name="Globals_CopyOnSelect.Content" xml:space="preserve">
|
||||
<value>Copy after selection is made</value>
|
||||
</data>
|
||||
<data name="Globals_CopyOnSelect.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, a selection is immediately copied to your clipboard upon creation. When unchecked, the selection persists and awaits further action.</value>
|
||||
</data>
|
||||
<data name="Globals_DefaultProfile.Header" xml:space="preserve">
|
||||
<value>Default profile</value>
|
||||
</data>
|
||||
<data name="Globals_DefaultProfile.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Profile that opens when clicking the '+' icon or by typing the key binding assigned to 'newTab'.</value>
|
||||
</data>
|
||||
<data name="Globals_DisableDynamicProfiles.Content" xml:space="preserve">
|
||||
<value>Automatically create new profiles when new shells are installed</value>
|
||||
</data>
|
||||
<data name="Globals_DisableDynamicProfiles.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Enables all of the dynamic profile generators, adding their profiles to the list of profiles on startup.</value>
|
||||
</data>
|
||||
<data name="Globals_ForceFullRepaint.Content" xml:space="preserve">
|
||||
<value>Redraw entire screen when display updates</value>
|
||||
</data>
|
||||
<data name="Globals_ForceFullRepaint.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the terminal will redraw the entire screen each frame. When unchecked, the terminal will render only the updates to the screen between frames.</value>
|
||||
</data>
|
||||
<data name="Globals_GlobalAppearance.Text" xml:space="preserve">
|
||||
<value>Global Appearance</value>
|
||||
</data>
|
||||
<data name="Globals_InitialCols.Header" xml:space="preserve">
|
||||
<value>Columns on first launch (in characters)</value>
|
||||
</data>
|
||||
<data name="Globals_InitialCols.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>The number of columns displayed in the window upon first load.</value>
|
||||
</data>
|
||||
<data name="Globals_InitialRows.Header" xml:space="preserve">
|
||||
<value>Rows on first launch (in characters)</value>
|
||||
</data>
|
||||
<data name="Globals_InitialRows.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>The number of rows displayed in the window upon first load.</value>
|
||||
</data>
|
||||
<data name="Globals_Interaction.Text" xml:space="preserve">
|
||||
<value>Interaction</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchPosition.Header" xml:space="preserve">
|
||||
<value>Launch position</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchPosition.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>The position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display.</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchSize.Header" xml:space="preserve">
|
||||
<value>Launch size</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchSize.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Defines whether the terminal will launch in a window, maximized, or full screen.</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchSizeDefault.Content" xml:space="preserve">
|
||||
<value>Default</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchSizeFullscreen.Content" xml:space="preserve">
|
||||
<value>Full screen</value>
|
||||
</data>
|
||||
<data name="Globals_LaunchSizeMaximized.Content" xml:space="preserve">
|
||||
<value>Maximized</value>
|
||||
</data>
|
||||
<data name="Globals_Rendering.Text" xml:space="preserve">
|
||||
<value>Rendering</value>
|
||||
</data>
|
||||
<data name="Globals_RenderingDisclaimer.Text" xml:space="preserve">
|
||||
<value>These settings may be useful for troubleshooting an issue, however they will impact your performance.</value>
|
||||
</data>
|
||||
<data name="Globals_ShowTitlebar.Content" xml:space="preserve">
|
||||
<value>Show the title bar</value>
|
||||
</data>
|
||||
<data name="Globals_ShowTitlebar.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the tabs are moved into the title bar and the title bar disappears. When unchecked, the title bar sits above the tabs.</value>
|
||||
</data>
|
||||
<data name="Globals_ShowTitleInTitlebar.Content" xml:space="preserve">
|
||||
<value>Show terminal title in title bar</value>
|
||||
</data>
|
||||
<data name="Globals_ShowTitleInTitlebar.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the title bar displays the title of the selected tab. When unchecked, the title bar displays 'Windows Terminal'.</value>
|
||||
</data>
|
||||
<data name="Globals_SnapToGridOnResize.Content" xml:space="preserve">
|
||||
<value>Snap window resizing to character grid</value>
|
||||
</data>
|
||||
<data name="Globals_SnapToGridOnResize.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the window will snap to the nearest character boundary on resize. When unchecked, the window will resize smoothly.</value>
|
||||
</data>
|
||||
<data name="Globals_SoftwareRendering.Content" xml:space="preserve">
|
||||
<value>Use software rendering</value>
|
||||
</data>
|
||||
<data name="Globals_SoftwareRendering.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the terminal will use the software renderer (a.k.a. WARP) instead of the hardware one.</value>
|
||||
</data>
|
||||
<data name="Globals_StartOnUserLogin.Content" xml:space="preserve">
|
||||
<value>Launch on machine startup</value>
|
||||
</data>
|
||||
<data name="Globals_StartOnUserLogin.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, this enables the launch of Windows Terminal at machine startup.</value>
|
||||
</data>
|
||||
<data name="Globals_Startup.Text" xml:space="preserve">
|
||||
<value>Startup</value>
|
||||
</data>
|
||||
<data name="Globals_TabWidthMode.Header" xml:space="preserve">
|
||||
<value>Tab width mode</value>
|
||||
</data>
|
||||
<data name="Globals_TabWidthMode.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the width of the tabs. 'Equal' sizes each tab to the same width. 'Title length' sizes each tab to the length of its title. 'Compact' sizes each tab to the length of its title when focused, and shrinks to the size of only the icon when the tab is unfocused.</value>
|
||||
<comment>'equal' must match the value for <Globals_TabWidthModeEqual.Content>. 'title length' must match the value for <Globals_TabWidthModeTitleLength.Content>. 'compact' must match the value for <Globals_TabWidthModeCompact.Content>.</comment>
|
||||
</data>
|
||||
<data name="Globals_TabWidthModeCompact.Content" xml:space="preserve">
|
||||
<value>Compact</value>
|
||||
</data>
|
||||
<data name="Globals_TabWidthModeEqual.Content" xml:space="preserve">
|
||||
<value>Equal</value>
|
||||
</data>
|
||||
<data name="Globals_TabWidthModeTitleLength.Content" xml:space="preserve">
|
||||
<value>Title length</value>
|
||||
</data>
|
||||
<data name="Globals_Theme.Header" xml:space="preserve">
|
||||
<value>Theme</value>
|
||||
</data>
|
||||
<data name="Globals_Theme.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the theme of the application. The value 'default' refers to the active Windows system theme.</value>
|
||||
<comment>'default' must match the value for <Globals_ThemeDefault.Content>.</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeDark.Content" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
</data>
|
||||
<data name="Globals_ThemeDefault.Content" xml:space="preserve">
|
||||
<value>Default</value>
|
||||
</data>
|
||||
<data name="Globals_ThemeLight.Content" xml:space="preserve">
|
||||
<value>Light</value>
|
||||
</data>
|
||||
<data name="Globals_WordDelimiters.Header" xml:space="preserve">
|
||||
<value>Word delimiters</value>
|
||||
</data>
|
||||
<data name="Globals_WordDelimiters.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Determines the delimiters used in a double click selection.</value>
|
||||
</data>
|
||||
<data name="Nav_AddNewProfile.Content" xml:space="preserve">
|
||||
<value>Add new</value>
|
||||
</data>
|
||||
<data name="Nav_Appearance.Content" xml:space="preserve">
|
||||
<value>Appearance</value>
|
||||
</data>
|
||||
<data name="Nav_AppearanceGlobal.Content" xml:space="preserve">
|
||||
<value>Global</value>
|
||||
</data>
|
||||
<data name="Nav_ColorSchemes.Content" xml:space="preserve">
|
||||
<value>Color schemes</value>
|
||||
</data>
|
||||
<data name="Nav_General.Content" xml:space="preserve">
|
||||
<value>General</value>
|
||||
</data>
|
||||
<data name="Nav_Home.Content" xml:space="preserve">
|
||||
<value>Home</value>
|
||||
</data>
|
||||
<data name="Nav_Interaction.Content" xml:space="preserve">
|
||||
<value>Interaction</value>
|
||||
</data>
|
||||
<data name="Nav_Launch.Content" xml:space="preserve">
|
||||
<value>Startup</value>
|
||||
</data>
|
||||
<data name="Nav_OpenJSON.Content" xml:space="preserve">
|
||||
<value>Open JSON file</value>
|
||||
</data>
|
||||
<data name="Nav_ProfileGlobal.Content" xml:space="preserve">
|
||||
<value>Global</value>
|
||||
</data>
|
||||
<data name="Nav_Profiles.Content" xml:space="preserve">
|
||||
<value>Profiles</value>
|
||||
</data>
|
||||
<data name="Nav_Rendering.Content" xml:space="preserve">
|
||||
<value>Rendering</value>
|
||||
</data>
|
||||
<data name="Profile_AcrylicOpacity.Header" xml:space="preserve">
|
||||
<value>Acrylic opacity</value>
|
||||
</data>
|
||||
<data name="Profile_AcrylicOpacity.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When acrylic is enabled, it sets the transparency of the window for the profile.</value>
|
||||
</data>
|
||||
<data name="Profile_Advanced.Header" xml:space="preserve">
|
||||
<value>Advanced</value>
|
||||
</data>
|
||||
<data name="Profile_AltGrAliasing.Content" xml:space="preserve">
|
||||
<value>AltGr aliasing</value>
|
||||
</data>
|
||||
<data name="Profile_AltGrAliasing.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>By default Windows treats Ctrl+Alt as an alias for AltGr. When unchecked, this behavior will be disabled.</value>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingMode.Header" xml:space="preserve">
|
||||
<value>Antialiasing text</value>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingMode.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Controls how text is antialiased in the renderer. Note that changing this setting will require starting a new terminal instance.</value>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingModeAliased.Content" xml:space="preserve">
|
||||
<value>Aliased</value>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingModeClearType.Content" xml:space="preserve">
|
||||
<value>ClearType</value>
|
||||
</data>
|
||||
<data name="Profile_AntialiasingModeGrayscale.Content" xml:space="preserve">
|
||||
<value>Grayscale</value>
|
||||
</data>
|
||||
<data name="Profile_Appearance.Header" xml:space="preserve">
|
||||
<value>Appearance</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundColor.Header" xml:space="preserve">
|
||||
<value>Background color</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundColorToolTip.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the background color of the text. Overrides the background from the color scheme.</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImage.Header" xml:space="preserve">
|
||||
<value>Background image</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImage.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the file location of the image to draw over the window background.</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignment.Content" xml:space="preserve">
|
||||
<value>Background image alignment</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignment.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets how the background image aligns to the boundaries of the window.</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentBottom.Text" xml:space="preserve">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentBottomLeft.Text" xml:space="preserve">
|
||||
<value>Bottom left</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentBottomRight.Text" xml:space="preserve">
|
||||
<value>Bottom right</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentCenter.Text" xml:space="preserve">
|
||||
<value>Center</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentLeft.Text" xml:space="preserve">
|
||||
<value>Left</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentRight.Text" xml:space="preserve">
|
||||
<value>Right</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentTop.Text" xml:space="preserve">
|
||||
<value>Top</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentTopLeft.Text" xml:space="preserve">
|
||||
<value>Top left</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageAlignmentTopRight.Text" xml:space="preserve">
|
||||
<value>Top right</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageBrowse.Content" xml:space="preserve">
|
||||
<value>Browse...</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageOpacity.Header" xml:space="preserve">
|
||||
<value>Background image opacity</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageOpacity.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the transparency of the background image.</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchMode.Header" xml:space="preserve">
|
||||
<value>Background image stretch mode</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchMode.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets how the background image is resized to fill the window.</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchModeFill.Content" xml:space="preserve">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchModeNone.Content" xml:space="preserve">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchModeUniform.Content" xml:space="preserve">
|
||||
<value>Uniform</value>
|
||||
</data>
|
||||
<data name="Profile_BackgroundImageStretchModeUniformToFill.Content" xml:space="preserve">
|
||||
<value>Uniform to fill</value>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExit.Header" xml:space="preserve">
|
||||
<value>How the profile closes</value>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExit.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets how the profile reacts to termination or failure to launch. Graceful will close when exit is typed or the process exits normally.</value>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExitAlways.Content" xml:space="preserve">
|
||||
<value>Always</value>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExitGraceful.Content" xml:space="preserve">
|
||||
<value>Graceful</value>
|
||||
</data>
|
||||
<data name="Profile_CloseOnExitNever.Content" xml:space="preserve">
|
||||
<value>Never</value>
|
||||
</data>
|
||||
<data name="Profile_ColorScheme.Content" xml:space="preserve">
|
||||
<value>Color scheme</value>
|
||||
</data>
|
||||
<data name="Profile_ColorScheme.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Name of the color scheme to use.</value>
|
||||
</data>
|
||||
<data name="Profile_Commandline.Header" xml:space="preserve">
|
||||
<value>Command line</value>
|
||||
</data>
|
||||
<data name="Profile_Commandline.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Executable used in the profile.</value>
|
||||
</data>
|
||||
<data name="Profile_CommandlineBrowse.Content" xml:space="preserve">
|
||||
<value>Browse...</value>
|
||||
</data>
|
||||
<data name="Profile_CursorColor.Header" xml:space="preserve">
|
||||
<value>Cursor color</value>
|
||||
</data>
|
||||
<data name="Profile_CursorColorToolTip.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the color of the cursor. Overrides the cursor color from the color scheme.</value>
|
||||
</data>
|
||||
<data name="Profile_CursorHeight.Header" xml:space="preserve">
|
||||
<value>Cursor height</value>
|
||||
</data>
|
||||
<data name="Profile_CursorHeight.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the percentage height of the cursor starting from the bottom. Only works with the vintage cursor shape.</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShape.Header" xml:space="preserve">
|
||||
<value>Cursor shape</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShape.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the shape of the cursor.</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShapeBar.Content" xml:space="preserve">
|
||||
<value>Bar</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShapeEmptyBox.Content" xml:space="preserve">
|
||||
<value>Empty box</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShapeFilledBox.Content" xml:space="preserve">
|
||||
<value>Filled box</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShapeUnderscore.Content" xml:space="preserve">
|
||||
<value>Underscore</value>
|
||||
</data>
|
||||
<data name="Profile_CursorShapeVintage.Content" xml:space="preserve">
|
||||
<value>Vintage</value>
|
||||
</data>
|
||||
<data name="Profile_FontFace.Header" xml:space="preserve">
|
||||
<value>Font face</value>
|
||||
</data>
|
||||
<data name="Profile_FontFace.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Name of the font face used in the profile.</value>
|
||||
</data>
|
||||
<data name="Profile_FontSize.Header" xml:space="preserve">
|
||||
<value>Font size</value>
|
||||
</data>
|
||||
<data name="Profile_FontSize.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Size of the font in points.</value>
|
||||
</data>
|
||||
<data name="Profile_FontWeight.Header" xml:space="preserve">
|
||||
<value>Font weight</value>
|
||||
</data>
|
||||
<data name="Profile_FontWeight.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the weight (lightness or heaviness of the strokes) for the given font.</value>
|
||||
</data>
|
||||
<data name="Profile_ForegroundColor.Header" xml:space="preserve">
|
||||
<value>Foreground color</value>
|
||||
</data>
|
||||
<data name="Profile_ForegroundColorToolTip.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the text color. Overrides the foreground from the color scheme.</value>
|
||||
</data>
|
||||
<data name="Profile_General.Header" xml:space="preserve">
|
||||
<value>General</value>
|
||||
</data>
|
||||
<data name="Profile_Hidden.Content" xml:space="preserve">
|
||||
<value>Hide profile from dropdown</value>
|
||||
</data>
|
||||
<data name="Profile_Hidden.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>If checked, 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.</value>
|
||||
</data>
|
||||
<data name="Profile_HistorySize.Header" xml:space="preserve">
|
||||
<value>History size</value>
|
||||
</data>
|
||||
<data name="Profile_HistorySize.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>The number of lines above the ones displayed in the window you can scroll back to.</value>
|
||||
</data>
|
||||
<data name="Profile_Icon.Header" xml:space="preserve">
|
||||
<value>Icon</value>
|
||||
</data>
|
||||
<data name="Profile_Icon.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Image file location of the icon used in the profile. Displays within the tab and the dropdown menu.</value>
|
||||
</data>
|
||||
<data name="Profile_IconBrowse.Content" xml:space="preserve">
|
||||
<value>Browse...</value>
|
||||
</data>
|
||||
<data name="Profile_Padding.Header" xml:space="preserve">
|
||||
<value>Padding</value>
|
||||
</data>
|
||||
<data name="Profile_Padding.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the padding around the text within the window. Can have three different formats: '#' sets the same padding for all sides. '#, #' sets the same padding for left-right and top-bottom. '#, #, #, #' sets the padding individually for left, top, right, and bottom.</value>
|
||||
</data>
|
||||
<data name="Profile_RetroTerminalEffect.Content" xml:space="preserve">
|
||||
<value>Retro terminal effects</value>
|
||||
</data>
|
||||
<data name="Profile_RetroTerminalEffect.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, enables retro terminal effects such as glowing text and scan lines.</value>
|
||||
</data>
|
||||
<data name="Profile_ScrollbarVisibility.Header" xml:space="preserve">
|
||||
<value>Scrollbar visibility</value>
|
||||
</data>
|
||||
<data name="Profile_ScrollbarVisibility.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Defines the visibility of the scrollbar.</value>
|
||||
</data>
|
||||
<data name="Profile_ScrollbarVisibilityHidden.Content" xml:space="preserve">
|
||||
<value>Hidden</value>
|
||||
</data>
|
||||
<data name="Profile_ScrollbarVisibilityVisible.Content" xml:space="preserve">
|
||||
<value>Visible</value>
|
||||
</data>
|
||||
<data name="Profile_SelectionBackgroundColor.Header" xml:space="preserve">
|
||||
<value>Selection background color</value>
|
||||
</data>
|
||||
<data name="Profile_SelectionBackgroundColorToolTip.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Sets the background color of selected text. Overrides the selection background set in the color scheme.</value>
|
||||
</data>
|
||||
<data name="Profile_SnapOnInput.Content" xml:space="preserve">
|
||||
<value>Scroll to input when typing</value>
|
||||
</data>
|
||||
<data name="Profile_SnapOnInput.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the window will scroll to the command input line when typing. Otherwise, the window will not scroll when you start typing.</value>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectory.Header" xml:space="preserve">
|
||||
<value>Starting directory</value>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectory.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>The directory the shell starts in when it is loaded.</value>
|
||||
</data>
|
||||
<data name="Profile_StartingDirectoryBrowse.Content" xml:space="preserve">
|
||||
<value>Browse...</value>
|
||||
</data>
|
||||
<data name="Profile_SuppressApplicationTitle.Content" xml:space="preserve">
|
||||
<value>Suppress title changes</value>
|
||||
</data>
|
||||
<data name="Profile_SuppressApplicationTitle.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the tab title overrides the default title of the tab and any title change messages from the application will be suppressed.</value>
|
||||
</data>
|
||||
<data name="Profile_TabTitle.Header" xml:space="preserve">
|
||||
<value>Tab title</value>
|
||||
</data>
|
||||
<data name="Profile_TabTitle.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Replaces the name as the title to pass to the shell on startup. Some shells (like bash) may choose to ignore this initial value, while others (CMD, PowerShell) may use this value over the lifetime of the application.</value>
|
||||
</data>
|
||||
<data name="Profile_UseAcrylic.Content" xml:space="preserve">
|
||||
<value>Enable acrylic</value>
|
||||
</data>
|
||||
<data name="Profile_UseAcrylic.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>When checked, the window will have an acrylic background. When unchecked, the window will have a plain, untextured background.</value>
|
||||
</data>
|
||||
<data name="Settings_ResetSettingsButton.Content" xml:space="preserve">
|
||||
<value>Reset</value>
|
||||
</data>
|
||||
<data name="Settings_ResetSettingsButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Reset your settings to your previous save.</value>
|
||||
</data>
|
||||
<data name="Settings_SaveSettingsButton.Content" xml:space="preserve">
|
||||
<value>Save</value>
|
||||
</data>
|
||||
<data name="Settings_UnsavedSettingsWarning.Text" xml:space="preserve">
|
||||
<value>⚠ You have unsaved changes.</value>
|
||||
<comment>{Locked="⚠"}</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "SettingsEditorViewModel.h"
|
||||
#include "SettingsEditorViewModel.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
SettingsEditorViewModel::SettingsEditorViewModel()
|
||||
{
|
||||
_HomeGridItems = winrt::single_threaded_observable_vector<Editor::HomeGridItem>();
|
||||
}
|
||||
|
||||
Editor::HomeGridItem SettingsEditorViewModel::HomeGridItem()
|
||||
{
|
||||
return _HomeGridItem;
|
||||
}
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<Editor::HomeGridItem> SettingsEditorViewModel::HomeGridItems()
|
||||
{
|
||||
return _HomeGridItems;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
#include "SettingsEditorViewModel.g.h"
|
||||
#include "HomeGridItem.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct SettingsEditorViewModel : SettingsEditorViewModelT<SettingsEditorViewModel>
|
||||
{
|
||||
SettingsEditorViewModel();
|
||||
|
||||
Editor::HomeGridItem HomeGridItem();
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<Editor::HomeGridItem> HomeGridItems();
|
||||
|
||||
private:
|
||||
Editor::HomeGridItem _HomeGridItem{ nullptr };
|
||||
Windows::Foundation::Collections::IObservableVector<Editor::HomeGridItem> _HomeGridItems;
|
||||
};
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "HomeGridItem.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Editor
|
||||
{
|
||||
runtimeclass SettingsEditorViewModel
|
||||
{
|
||||
HomeGridItem HomeGridItem { get; };
|
||||
Windows.Foundation.Collections.IObservableVector<HomeGridItem> HomeGridItems { get; };
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "SplitPaneOptionPanelControl.h"
|
||||
#include "SplitPaneOptionPanelControl.g.cpp"
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace winrt::Windows::UI::Xaml::Data;
|
||||
using namespace winrt::Windows::UI::Xaml::Input;
|
||||
using namespace winrt::Windows::UI::Xaml::Media;
|
||||
using namespace winrt::Windows::UI::Xaml::Navigation;
|
||||
using namespace winrt::Microsoft::Terminal::Settings;
|
||||
|
||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
SplitPaneOptionPanelControl::SplitPaneOptionPanelControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
argumentComboBox = FindName(c_argumentComboBoxName).as<Controls::ComboBox>();
|
||||
argumentInputTextBox = FindName(c_textBoxName).as<Controls::TextBox>();
|
||||
splitModeComboBox = FindName(c_comboBoxName).as<Controls::ComboBox>();
|
||||
}
|
||||
|
||||
void SplitPaneOptionPanelControl::ComboBox_SelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& /*e*/)
|
||||
{
|
||||
bool isSplitMode = (GetSelectedItemTag(sender) == L"splitMode");
|
||||
splitModeComboBox.Visibility(isSplitMode ? Visibility::Visible : Visibility::Collapsed);
|
||||
argumentInputTextBox.Visibility(isSplitMode ? Visibility::Collapsed : Visibility::Visible);
|
||||
}
|
||||
|
||||
hstring SplitPaneOptionPanelControl::Argument()
|
||||
{
|
||||
return GetSelectedItemTag(argumentComboBox);
|
||||
}
|
||||
|
||||
hstring SplitPaneOptionPanelControl::InputValue()
|
||||
{
|
||||
if (Argument() == L"splitMode")
|
||||
{
|
||||
return GetSelectedItemTag(splitModeComboBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
return argumentInputTextBox.Text();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SplitPaneOptionPanelControl.g.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
struct SplitPaneOptionPanelControl : SplitPaneOptionPanelControlT<SplitPaneOptionPanelControl>
|
||||
{
|
||||
SplitPaneOptionPanelControl();
|
||||
|
||||
void ComboBox_SelectionChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& e);
|
||||
|
||||
hstring Argument();
|
||||
hstring InputValue();
|
||||
|
||||
private:
|
||||
const hstring c_argumentComboBoxName = L"argumentComboBox";
|
||||
const hstring c_textBoxName = L"splitPaneTextBox";
|
||||
const hstring c_comboBoxName = L"splitPaneComboBox";
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::ComboBox argumentComboBox;
|
||||
winrt::Windows::UI::Xaml::Controls::TextBox argumentInputTextBox;
|
||||
winrt::Windows::UI::Xaml::Controls::ComboBox splitModeComboBox;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(SplitPaneOptionPanelControl);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user