mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[FancyZones] Use accent color and theme (#14158)
* use accent color and theme * typo * Updated FZ color UX (#14171) Co-authored-by: Laute <Niels.Laute@philips.com> * fix resources * rebase fix * label updated Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
committed by
GitHub
parent
3ead98a770
commit
e19ecd2ba1
@@ -131,10 +131,8 @@ ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
|
||||
// Draw backdrop
|
||||
m_renderTarget->Clear(D2D1::ColorF(0.f, 0.f, 0.f, 0.f));
|
||||
|
||||
ID2D1SolidColorBrush* textBrush = nullptr;
|
||||
IDWriteTextFormat* textFormat = nullptr;
|
||||
|
||||
m_renderTarget->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black, animationAlpha), &textBrush);
|
||||
auto writeFactory = GetWriteFactory();
|
||||
|
||||
if (writeFactory)
|
||||
@@ -144,6 +142,7 @@ ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
|
||||
|
||||
for (auto drawableRect : m_sceneRects)
|
||||
{
|
||||
ID2D1SolidColorBrush* textBrush = nullptr;
|
||||
ID2D1SolidColorBrush* borderBrush = nullptr;
|
||||
ID2D1SolidColorBrush* fillBrush = nullptr;
|
||||
|
||||
@@ -151,6 +150,7 @@ ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
|
||||
drawableRect.borderColor.a *= animationAlpha;
|
||||
drawableRect.fillColor.a *= animationAlpha;
|
||||
|
||||
m_renderTarget->CreateSolidColorBrush(drawableRect.textColor, &textBrush);
|
||||
m_renderTarget->CreateSolidColorBrush(drawableRect.borderColor, &borderBrush);
|
||||
m_renderTarget->CreateSolidColorBrush(drawableRect.fillColor, &fillBrush);
|
||||
|
||||
@@ -174,6 +174,11 @@ ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
|
||||
textFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
|
||||
m_renderTarget->DrawTextW(idStr.c_str(), (UINT32)idStr.size(), textFormat, drawableRect.rect, textBrush);
|
||||
}
|
||||
|
||||
if (textBrush)
|
||||
{
|
||||
textBrush->Release();
|
||||
}
|
||||
}
|
||||
|
||||
if (textFormat)
|
||||
@@ -181,11 +186,6 @@ ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
|
||||
textFormat->Release();
|
||||
}
|
||||
|
||||
if (textBrush)
|
||||
{
|
||||
textBrush->Release();
|
||||
}
|
||||
|
||||
// The lock must be released here, as EndDraw() will wait for vertical sync
|
||||
lock.unlock();
|
||||
|
||||
@@ -289,6 +289,7 @@ void ZoneWindowDrawing::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
|
||||
auto borderColor = ConvertColor(colors.borderColor);
|
||||
auto inactiveColor = ConvertColor(colors.primaryColor);
|
||||
auto highlightColor = ConvertColor(colors.highlightColor);
|
||||
auto textColor = ConvertColor(colors.textColor);
|
||||
|
||||
inactiveColor.a = colors.highlightOpacity / 100.f;
|
||||
highlightColor.a = colors.highlightOpacity / 100.f;
|
||||
@@ -313,6 +314,7 @@ void ZoneWindowDrawing::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
|
||||
.rect = ConvertRect(zone->GetZoneRect()),
|
||||
.borderColor = borderColor,
|
||||
.fillColor = inactiveColor,
|
||||
.textColor = textColor,
|
||||
.id = zone->Id()
|
||||
};
|
||||
|
||||
@@ -334,6 +336,7 @@ void ZoneWindowDrawing::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
|
||||
.rect = ConvertRect(zone->GetZoneRect()),
|
||||
.borderColor = borderColor,
|
||||
.fillColor = highlightColor,
|
||||
.textColor = textColor,
|
||||
.id = zone->Id()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user