mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[FancyZones] Improve code quality (part 2: WorkArea init) (#23030)
* init WorkArea with a rectangle * keep the highlighted zones state in a separate class
This commit is contained in:
@@ -733,7 +733,17 @@ void FancyZones::AddWorkArea(HMONITOR monitor, const FancyZonesDataTypes::WorkAr
|
||||
parentId = parentArea->UniqueId();
|
||||
}
|
||||
|
||||
auto workArea = MakeWorkArea(m_hinstance, monitor, id, parentId);
|
||||
FancyZonesUtils::Rect rect{};
|
||||
if (monitor)
|
||||
{
|
||||
rect = MonitorUtils::GetWorkAreaRect(monitor);
|
||||
}
|
||||
else
|
||||
{
|
||||
rect = FancyZonesUtils::GetAllMonitorsCombinedRect<&MONITORINFO::rcWork>();
|
||||
}
|
||||
|
||||
auto workArea = MakeWorkArea(m_hinstance, id, parentId, rect);
|
||||
if (workArea)
|
||||
{
|
||||
m_workAreaHandler.AddWorkArea(VirtualDesktop::instance().GetCurrentVirtualDesktopId(), monitor, workArea);
|
||||
|
||||
Reference in New Issue
Block a user