Win arrows revisited (#5932)

* Added the setting

* Refactored existing code, the main feature isn't implemented yet

* Renamed a method

* Updated a comment in IZoneWindow

* Added the zone selection algorithm, didn't test it

* Basic features work

* Single monitor cycling works

* Seems that the feature works well

* Polished the settings page

* Rebase fix

* Fixed a null pointer dereference

* Use classic if syntax

* Fixed bad indentation

How did these lines unindent themselves?

* Removed TODO comment

* Rebase fix

* Another rebase fix
This commit is contained in:
Ivan Stošić
2020-08-21 12:53:03 +02:00
committed by GitHub
parent 64c51a49a0
commit 976116a012
24 changed files with 657 additions and 173 deletions

View File

@@ -527,7 +527,7 @@ namespace FancyZonesUnitTests
{
PrepareFZData();
auto zoneWindow = MakeZoneWindow(winrt::make_self<MockZoneWindowHost>().get(), m_hInst, m_monitor, m_uniqueId.str(), {}, false);
const auto window = Mocks::Window();
zoneWindow->MoveSizeEnter(window);
@@ -626,14 +626,14 @@ namespace FancyZonesUnitTests
zoneWindow->MoveWindowIntoZoneByIndex(Mocks::Window(), 0);
}
TEST_METHOD(MoveWindowIntoZoneByDirection)
TEST_METHOD(MoveWindowIntoZoneByDirectionAndIndex)
{
PrepareFZData();
auto zoneWindow = MakeZoneWindow(winrt::make_self<MockZoneWindowHost>().get(), m_hInst, m_monitor, m_uniqueId.str(), {}, false);
Assert::IsNotNull(zoneWindow->ActiveZoneSet());
const auto window = Mocks::WindowCreate(m_hInst);
zoneWindow->MoveWindowIntoZoneByDirection(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirectionAndIndex(window, VK_RIGHT, true);
const auto& actualAppZoneHistory = m_fancyZonesData.GetAppZoneHistoryMap();
Assert::AreEqual((size_t)1, actualAppZoneHistory.size());
@@ -649,9 +649,9 @@ namespace FancyZonesUnitTests
Assert::IsNotNull(zoneWindow->ActiveZoneSet());
const auto window = Mocks::WindowCreate(m_hInst);
zoneWindow->MoveWindowIntoZoneByDirection(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirection(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirection(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirectionAndIndex(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirectionAndIndex(window, VK_RIGHT, true);
zoneWindow->MoveWindowIntoZoneByDirectionAndIndex(window, VK_RIGHT, true);
const auto& actualAppZoneHistory = m_fancyZonesData.GetAppZoneHistoryMap();
Assert::AreEqual((size_t)1, actualAppZoneHistory.size());
@@ -776,7 +776,7 @@ namespace FancyZonesUnitTests
auto zone = MakeZone(RECT{ 50, 50, 300, 300 });
zoneWindow->ActiveZoneSet()->AddZone(zone);
zoneWindow->MoveWindowIntoZoneByDirection(window, VK_LEFT, true);
zoneWindow->MoveWindowIntoZoneByDirectionAndIndex(window, VK_LEFT, true);
RECT inZoneRect;
GetWindowRect(window, &inZoneRect);