mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibGfx: Filled checked toolbar buttons with a dither pattern
This makes them stand out a bit from buttons that are being pressed (but not checked.)
This commit is contained in:
@@ -165,7 +165,12 @@ void ClassicStylePainter::paint_button(Painter& painter, const IntRect& rect, co
|
||||
|
||||
if (pressed || checked) {
|
||||
// Base
|
||||
painter.fill_rect({ 1, 1, rect.width() - 2, rect.height() - 2 }, button_color);
|
||||
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);
|
||||
}
|
||||
|
||||
// Sunken shadow
|
||||
painter.draw_line({ 1, 1 }, { rect.width() - 2, 1 }, shadow_color);
|
||||
|
||||
Reference in New Issue
Block a user