diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-14 21:47:07 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-14 21:47:07 +0100 |
commit | 96233bfc53b607f583bc01ede14b575b0cc5bddc (patch) | |
tree | c035f4bb677f8fae4d01725286f7e20ac29af1fc /Libraries/LibGfx | |
parent | 396b09a1ec5076eb73a58170f69975590572bf26 (diff) | |
download | serenity-96233bfc53b607f583bc01ede14b575b0cc5bddc.zip |
LibGfx: Draw checked buttons with a dithered base background
This looks just so right in the taskbar. :^)
Diffstat (limited to 'Libraries/LibGfx')
-rw-r--r-- | Libraries/LibGfx/ClassicStylePainter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Libraries/LibGfx/ClassicStylePainter.cpp b/Libraries/LibGfx/ClassicStylePainter.cpp index d4087e0dcb..4422152374 100644 --- a/Libraries/LibGfx/ClassicStylePainter.cpp +++ b/Libraries/LibGfx/ClassicStylePainter.cpp @@ -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); |