| 76 | } |
| 77 | |
| 78 | HRESULT TaskbarAppearanceService::SetTaskbarBlur(HWND taskbar, UINT color, FLOAT blurAmount) try |
| 79 | { |
| 80 | if (const auto info = GetTaskbarInfo(taskbar)) |
| 81 | { |
| 82 | if (info->background.control && info->background.originalFill) |
| 83 | { |
| 84 | const winrt::Windows::UI::Color tint = Util::Color::FromABGR(color); |
| 85 | const wfn::float4 tintHdr = { |
| 86 | tint.R / 255.0f, |
| 87 | tint.G / 255.0f, |
| 88 | tint.B / 255.0f, |
| 89 | tint.A / 255.0f |
| 90 | }; |
| 91 | |
| 92 | auto compositor = wuxh::ElementCompositionPreview::GetElementVisual(info->background.control).Compositor(); |
| 93 | info->background.control.Fill(winrt::make<XamlBlurBrush>(std::move(compositor), blurAmount, tintHdr)); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | return S_OK; |
| 98 | } |
| 99 | catch (...) |
| 100 | { |
| 101 | return winrt::to_hresult(); |
| 102 | } |
| 103 | |
| 104 | HRESULT TaskbarAppearanceService::ReturnTaskbarToDefaultAppearance(HWND taskbar) try |
| 105 | { |