mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibGUI: Brighten buttons when hovering over them :^)
This commit is contained in:
parent
7976ef7a79
commit
add93bf593
Notes:
sideshowbarker
2024-07-19 08:02:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/add93bf593c
1 changed files with 7 additions and 3 deletions
|
@ -64,10 +64,14 @@ void Button::paint_event(PaintEvent& event)
|
|||
if (is_being_pressed() || is_checked())
|
||||
painter.translate(1, 1);
|
||||
if (m_icon) {
|
||||
if (is_enabled())
|
||||
painter.blit(icon_location, *m_icon, m_icon->rect());
|
||||
else
|
||||
if (is_enabled()) {
|
||||
if (is_hovered())
|
||||
painter.blit_brightened(icon_location, *m_icon, m_icon->rect());
|
||||
else
|
||||
painter.blit(icon_location, *m_icon, m_icon->rect());
|
||||
} else {
|
||||
painter.blit_dimmed(icon_location, *m_icon, m_icon->rect());
|
||||
}
|
||||
}
|
||||
auto& font = is_checked() ? Gfx::Font::default_bold_font() : this->font();
|
||||
if (m_icon && !text().is_empty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue