mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGfx: Draw checked buttons with a dithered base background
This looks just so right in the taskbar. :^)
This commit is contained in:
parent
396b09a1ec
commit
96233bfc53
Notes:
sideshowbarker
2024-07-19 00:52:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/96233bfc53b
@ -113,7 +113,11 @@ static void paint_button_new(Painter& painter, const IntRect& rect, const Palett
|
||||
|
||||
if (pressed || checked) {
|
||||
// Base
|
||||
painter.fill_rect({ 1, 1, rect.width() - 2, rect.height() - 2 }, button_color);
|
||||
Gfx::IntRect base_rect { 1, 1, rect.width() - 2, rect.height() - 2 };
|
||||
if (checked && !pressed)
|
||||
painter.fill_rect_with_dither_pattern(base_rect, palette.button().lightened(1.3f), palette.button());
|
||||
else
|
||||
painter.fill_rect(base_rect, button_color);
|
||||
|
||||
// Top shadow
|
||||
painter.draw_line({ 0, 0 }, { rect.width() - 2, 0 }, shadow_color2);
|
||||
|
Loading…
Reference in New Issue
Block a user