mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +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:
parent
06a29e8aa5
commit
9f118e3a26
Notes:
sideshowbarker
2024-07-19 01:47:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9f118e3a26f
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue