[FancyZones] Cleanup (#14274)

* [FancyZones] Remove obsolete code

The field `m_zoneSets` is unused, and may be removed.

* [FancyZones] Remove obsolete code

The field `m_windows` is unused, and may be removed.

* [FancyZones] Move adjustment of `RECT` to utils.cpp

By doing so, also fix a bug where a non-`WS_SIZEBOX` window (a window that should not be resized) was resized (and not properly resized) if it was zoned into more than one zone.

* [FancyZones] Complete rename `ZoneWindow` -> `WorkArea`

Fix leftovers from "[FancyZones] Rename ZoneWindow -> WorkArea (#12223)"

* [FancyZones] Refer to the move/size action as dragging

* [FancyZones] Rename `ActiveZoneSet` -> `ZoneSet`

There is only one zone set used by a work area.

* [FancyZones] Rename `zoneUuid` -> `layoutUuid`

The variable holds the UUID of the layout (not of a zone).

Co-authored-by: float4 <float4-unspecified-mail>
This commit is contained in:
FLOAT4
2021-11-11 19:23:22 +02:00
committed by GitHub
parent 0aa213a31d
commit 9bb6d57515
15 changed files with 272 additions and 281 deletions

View File

@@ -297,9 +297,9 @@ namespace FancyZonesUnitTests
{
winrt::com_ptr<IZone> zone = MakeZone({ 0, 0, 100, 100 }, 1);
HWND window = Mocks::Window();
HWND zoneWindow = Mocks::Window();
HWND workArea = Mocks::Window();
m_set->AddZone(zone);
m_set->MoveWindowIntoZoneByIndexSet(window, zoneWindow, { 0 });
m_set->MoveWindowIntoZoneByIndexSet(window, workArea, { 0 });
auto actual = m_set->GetZoneIndexSetFromWindow(Mocks::Window());
Assert::IsTrue(std::vector<ZoneIndex>{} == actual);
@@ -309,9 +309,9 @@ namespace FancyZonesUnitTests
{
winrt::com_ptr<IZone> zone = MakeZone({ 0, 0, 100, 100 }, 1);
HWND window = Mocks::Window();
HWND zoneWindow = Mocks::Window();
HWND workArea = Mocks::Window();
m_set->AddZone(zone);
m_set->MoveWindowIntoZoneByIndexSet(window, zoneWindow, { 0 });
m_set->MoveWindowIntoZoneByIndexSet(window, workArea, { 0 });
auto actual = m_set->GetZoneIndexSetFromWindow(nullptr);
Assert::IsTrue(std::vector<ZoneIndex>{} == actual);
@@ -432,7 +432,7 @@ namespace FancyZonesUnitTests
TEST_METHOD (MoveWindowIntoZoneByPointDropAddWindow)
{
const auto window = Mocks::Window();
const auto zoneWindow = Mocks::Window();
const auto workArea = Mocks::Window();
winrt::com_ptr<IZone> zone1 = MakeZone({ 0, 0, 100, 100 }, 0);
winrt::com_ptr<IZone> zone2 = MakeZone({ 10, 10, 90, 90 }, 1);
@@ -450,7 +450,7 @@ namespace FancyZonesUnitTests
TEST_METHOD (MoveWindowIntoZoneByPointDropAddWindowToSameZone)
{
const auto window = Mocks::Window();
const auto zoneWindow = Mocks::Window();
const auto workArea = Mocks::Window();
winrt::com_ptr<IZone> zone1 = MakeZone({ 0, 0, 100, 100 }, 0);
winrt::com_ptr<IZone> zone2 = MakeZone({ 10, 10, 90, 90 }, 1);
@@ -468,7 +468,7 @@ namespace FancyZonesUnitTests
TEST_METHOD (MoveWindowIntoZoneByPointSeveralZonesWithSameWindow)
{
const auto window = Mocks::Window();
const auto zoneWindow = Mocks::Window();
const auto workArea = Mocks::Window();
winrt::com_ptr<IZone> zone1 = MakeZone({ 0, 0, 100, 100 }, 0);
winrt::com_ptr<IZone> zone2 = MakeZone({ 10, 10, 90, 90 }, 1);