[FancyZones] draw active zones on top of inactive zones (#4727)

This commit is contained in:
Enrico Giordani
2020-07-03 17:04:52 +02:00
committed by GitHub
parent 7dabcc00ed
commit f9a5242e75

View File

@@ -163,6 +163,7 @@ namespace ZoneWindowDrawUtils
isHighlighted[x] = true; isHighlighted[x] = true;
} }
// First draw the inactive zones
for (auto iter = zones.begin(); iter != zones.end(); iter++) for (auto iter = zones.begin(); iter != zones.end(); iter++)
{ {
int zoneId = static_cast<int>(iter - zones.begin()); int zoneId = static_cast<int>(iter - zones.begin());
@@ -188,7 +189,19 @@ namespace ZoneWindowDrawUtils
DrawZone(hdc, colorViewer, zone, zones, flashMode); DrawZone(hdc, colorViewer, zone, zones, flashMode);
} }
} }
else }
// Draw the active zones on top of the inactive zones
for (auto iter = zones.begin(); iter != zones.end(); iter++)
{
int zoneId = static_cast<int>(iter - zones.begin());
winrt::com_ptr<IZone> zone = iter->try_as<IZone>();
if (!zone)
{
continue;
}
if (isHighlighted[zoneId])
{ {
colorHighlight.fill = highlightColor; colorHighlight.fill = highlightColor;
colorHighlight.border = zoneBorderColor; colorHighlight.border = zoneBorderColor;