Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Tab to a WinRT type #4350

Merged
20 commits merged into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(actionAndArgs.Args());
auto myArgs = actionAndArgs.Args().try_as<SwitchToTabArgs>();
VERIFY_IS_NOT_NULL(myArgs);
VERIFY_ARE_EQUAL(2, myArgs.TabIndex());
VERIFY_ARE_EQUAL(static_cast<uint32_t>(2), myArgs.TabIndex());
}

{
Expand Down
6 changes: 3 additions & 3 deletions src/cascadia/LocalTests_TerminalApp/TabTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ namespace TerminalAppLocalTests

void TabTests::TryCreateTab()
{
// If you leave the Tab shared_ptr owned by the RunOnUIThread lambda, it
// If you leave the Tab ptr owned by the RunOnUIThread lambda, it
// will crash when the test tears down. Not totally clear why, but make
// sure it's owned outside the lambda
std::shared_ptr<Tab> newTab{ nullptr };
winrt::com_ptr<winrt::TerminalApp::implementation::Tab> newTab{ nullptr };

auto result = RunOnUIThread([&newTab]() {
// Try creating all of:
Expand All @@ -135,7 +135,7 @@ namespace TerminalAppLocalTests
winrt::Microsoft::Terminal::TerminalControl::TermControl term{ settings, conn };
VERIFY_IS_NOT_NULL(term);

newTab = std::make_shared<Tab>(profileGuid, term);
newTab = winrt::make_self<winrt::TerminalApp::implementation::Tab>(profileGuid, term);
VERIFY_IS_NOT_NULL(newTab);
});

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/ActionArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace winrt::TerminalApp::implementation
struct SwitchToTabArgs : public SwitchToTabArgsT<SwitchToTabArgs>
{
SwitchToTabArgs() = default;
GETSET_PROPERTY(int32_t, TabIndex, 0);
GETSET_PROPERTY(uint32_t, TabIndex, 0);

static constexpr std::string_view TabIndexKey{ "index" };

Expand All @@ -163,7 +163,7 @@ namespace winrt::TerminalApp::implementation
auto args = winrt::make_self<SwitchToTabArgs>();
if (auto tabIndex{ json[JsonKey(TabIndexKey)] })
{
args->_TabIndex = tabIndex.asInt();
args->_TabIndex = tabIndex.asUInt();
}
return *args;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/ActionArgs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace TerminalApp

[default_interface] runtimeclass SwitchToTabArgs : IActionArgs
{
Int32 TabIndex { get; };
UInt32 TabIndex { get; };
};

[default_interface] runtimeclass ResizePaneArgs : IActionArgs
Expand Down
Loading