1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

Taskbar: Tweak taskbar button progress bar rendering

The rects didn't take the "thin cap" button style into account, causing
in-button progress bars to look a little off.
This commit is contained in:
Andreas Kling 2022-01-10 02:04:09 +01:00
parent 05de9b82b8
commit d7475449cc

View file

@ -121,7 +121,9 @@ void TaskbarButton::paint_event(GUI::PaintEvent& event)
if (window.progress().has_value()) { if (window.progress().has_value()) {
auto adjusted_rect = rect().shrunken(4, 4); auto adjusted_rect = rect().shrunken(4, 4);
if (is_being_pressed() || is_checked()) { if (!is_being_pressed() && !is_checked()) {
adjusted_rect.translate_by(-1, -1);
adjusted_rect.set_width(adjusted_rect.width() + 1);
adjusted_rect.set_height(adjusted_rect.height() + 1); adjusted_rect.set_height(adjusted_rect.height() + 1);
} }
paint_custom_progressbar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress().value(), text(), font, text_alignment()); paint_custom_progressbar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress().value(), text(), font, text_alignment());