1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

QuickShow: Use checkerboard background to show transparency

This commit is contained in:
Tibor Nagy 2020-04-05 13:13:32 +02:00 committed by Andreas Kling
parent e14d27867c
commit a4f6f8e0e7
Notes: sideshowbarker 2024-07-19 07:53:46 +09:00

View file

@ -31,11 +31,11 @@
#include <LibGUI/Painter.h>
#include <LibGUI/Window.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Palette.h>
QSWidget::QSWidget()
{
set_fill_with_background_color(true);
set_background_color(Color::Black);
set_fill_with_background_color(false);
}
QSWidget::~QSWidget()
@ -74,6 +74,7 @@ void QSWidget::paint_event(GUI::PaintEvent& event)
GUI::Painter painter(*this);
painter.add_clip_rect(event.rect());
painter.fill_rect_with_checkerboard(rect(), { 8, 8 }, palette().base().darkened(0.9), palette().base());
painter.draw_scaled_bitmap(m_bitmap_rect, *m_bitmap, m_bitmap->rect());
}