mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
QuickShow: Use checkerboard background to show transparency
This commit is contained in:
parent
e14d27867c
commit
a4f6f8e0e7
Notes:
sideshowbarker
2024-07-19 07:53:46 +09:00
Author: https://github.com/xTibor
Commit: a4f6f8e0e7
Pull-request: https://github.com/SerenityOS/serenity/pull/1642
1 changed files with 3 additions and 2 deletions
|
@ -31,11 +31,11 @@
|
||||||
#include <LibGUI/Painter.h>
|
#include <LibGUI/Painter.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibGfx/Bitmap.h>
|
#include <LibGfx/Bitmap.h>
|
||||||
|
#include <LibGfx/Palette.h>
|
||||||
|
|
||||||
QSWidget::QSWidget()
|
QSWidget::QSWidget()
|
||||||
{
|
{
|
||||||
set_fill_with_background_color(true);
|
set_fill_with_background_color(false);
|
||||||
set_background_color(Color::Black);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSWidget::~QSWidget()
|
QSWidget::~QSWidget()
|
||||||
|
@ -74,6 +74,7 @@ void QSWidget::paint_event(GUI::PaintEvent& event)
|
||||||
GUI::Painter painter(*this);
|
GUI::Painter painter(*this);
|
||||||
painter.add_clip_rect(event.rect());
|
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());
|
painter.draw_scaled_bitmap(m_bitmap_rect, *m_bitmap, m_bitmap->rect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue