mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +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:
@@ -383,4 +383,19 @@ namespace MonitorUtils
|
||||
|
||||
return displays;
|
||||
}
|
||||
|
||||
FancyZonesUtils::Rect GetWorkAreaRect(HMONITOR monitor)
|
||||
{
|
||||
if (monitor)
|
||||
{
|
||||
MONITORINFO mi{};
|
||||
mi.cbSize = sizeof(mi);
|
||||
if (GetMonitorInfoW(monitor, &mi))
|
||||
{
|
||||
return FancyZonesUtils::Rect(mi.rcWork);
|
||||
}
|
||||
}
|
||||
|
||||
return FancyZonesUtils::Rect{};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user