Skip to content

Commit add93bf

Browse files
committed
LibGUI: Brighten buttons when hovering over them :^)
1 parent 7976ef7 commit add93bf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Libraries/LibGUI/Button.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ void Button::paint_event(PaintEvent& event)
6464
if (is_being_pressed() || is_checked())
6565
painter.translate(1, 1);
6666
if (m_icon) {
67-
if (is_enabled())
68-
painter.blit(icon_location, *m_icon, m_icon->rect());
69-
else
67+
if (is_enabled()) {
68+
if (is_hovered())
69+
painter.blit_brightened(icon_location, *m_icon, m_icon->rect());
70+
else
71+
painter.blit(icon_location, *m_icon, m_icon->rect());
72+
} else {
7073
painter.blit_dimmed(icon_location, *m_icon, m_icon->rect());
74+
}
7175
}
7276
auto& font = is_checked() ? Gfx::Font::default_bold_font() : this->font();
7377
if (m_icon && !text().is_empty()) {

0 commit comments

Comments
 (0)