Refactor common and fancyzones/utils (#6073)

* Move module-specific functions to module

* Refactor FZ utils

* Remove 'zonable' from FancyZonesWindowInfo

* Address PR comments

* Address PR comments

* Fix stuff after rebasing
This commit is contained in:
stefansjfw
2020-08-24 19:38:15 +02:00
committed by GitHub
parent 2817bf4d62
commit 9999a2b126
12 changed files with 705 additions and 690 deletions

View File

@@ -10,6 +10,8 @@
#include <utility>
using namespace FancyZonesUtils;
namespace
{
constexpr int C_MULTIPLIER = 10000;
@@ -399,7 +401,7 @@ ZoneSet::MoveWindowIntoZoneByDirectionAndPosition(HWND window, HWND windowZone,
windowRect.left -= windowZoneRect.left;
windowRect.right -= windowZoneRect.left;
size_t result = ChooseNextZoneByPosition(vkCode, windowRect, zoneRects);
size_t result = FancyZonesUtils::ChooseNextZoneByPosition(vkCode, windowRect, zoneRects);
if (result < zoneRects.size())
{
MoveWindowIntoZoneByIndex(window, windowZone, freeZoneIndices[result]);
@@ -408,8 +410,8 @@ ZoneSet::MoveWindowIntoZoneByDirectionAndPosition(HWND window, HWND windowZone,
else if (cycle)
{
// Try again from the position off the screen in the opposite direction to vkCode
windowRect = PrepareRectForCycling(windowRect, windowZoneRect, vkCode);
result = ChooseNextZoneByPosition(vkCode, windowRect, zoneRects);
windowRect = FancyZonesUtils::PrepareRectForCycling(windowRect, windowZoneRect, vkCode);
result = FancyZonesUtils::ChooseNextZoneByPosition(vkCode, windowRect, zoneRects);
if (result < zoneRects.size())
{