LibGUI: Blit brightened icon when try item is hovered
This commit is contained in:
parent
6bb96217aa
commit
08f465a47d
Notes:
sideshowbarker
2024-07-17 07:18:18 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/08f465a47d Pull-request: https://github.com/SerenityOS/serenity/pull/15192 Reviewed-by: https://github.com/kennethmyhra ✅
1 changed files with 6 additions and 2 deletions
|
@ -94,8 +94,12 @@ void Tray::paint_event(GUI::PaintEvent& event)
|
|||
text_rect.translate_by(1, 1);
|
||||
}
|
||||
|
||||
if (item.bitmap)
|
||||
painter.blit(icon_rect.location(), *item.bitmap, item.bitmap->rect());
|
||||
if (item.bitmap) {
|
||||
if (is_hovered)
|
||||
painter.blit_brightened(icon_rect.location(), *item.bitmap, item.bitmap->rect());
|
||||
else
|
||||
painter.blit(icon_rect.location(), *item.bitmap, item.bitmap->rect());
|
||||
}
|
||||
|
||||
auto const& font = is_checked ? this->font().bold_variant() : this->font();
|
||||
painter.draw_text(text_rect, item.text, font, Gfx::TextAlignment::CenterLeft, palette().color(Gfx::ColorRole::TrayText));
|
||||
|
|
Loading…
Add table
Reference in a new issue