1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

LibGfx+WindowServer: Move shadow-painting code to StylePainter

Specifically, this is to make it accessible to ThemeEditor, but there's
nothing about it that is especially window-specific.
This commit is contained in:
Sam Atkins 2021-10-27 11:59:58 +01:00 committed by Andreas Kling
parent cf188df86c
commit 885ca2f968
7 changed files with 104 additions and 97 deletions

View file

@ -7,6 +7,7 @@
#include "Overlays.h"
#include "Compositor.h"
#include "WindowManager.h"
#include <LibGfx/StylePainter.h>
namespace WindowServer {
@ -113,7 +114,7 @@ void RectangularOverlay::render(Gfx::Painter& painter, Screen const& screen)
Gfx::Painter bitmap_painter(*new_bitmap);
if (auto* shadow_bitmap = WindowManager::the().overlay_rect_shadow()) {
WindowFrame::paint_simple_rect_shadow(bitmap_painter, new_bitmap->rect(), shadow_bitmap->bitmap(scale_factor), true, true);
Gfx::StylePainter::paint_simple_rect_shadow(bitmap_painter, new_bitmap->rect(), shadow_bitmap->bitmap(scale_factor), true, true);
} else {
bitmap_painter.fill_rect(new_bitmap->rect(), Color(Color::Black).with_alpha(0xcc));
}