1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibGUI+LibGfx+WindowServer: Auto-generate disabled action icons :^)

This patch adds a simple filter that makes button and menu item icons
have that "'90s disabled" look when disabled. It's pretty awesome.
This commit is contained in:
Andreas Kling 2020-10-27 21:17:50 +01:00
parent ea14c67e29
commit 3ec19ae4b6
5 changed files with 23 additions and 3 deletions

View file

@ -78,7 +78,7 @@ void Button::paint_event(PaintEvent& event)
else
painter.blit(icon_location, *m_icon, m_icon->rect());
} else {
painter.blit_dimmed(icon_location, *m_icon, m_icon->rect());
painter.blit_disabled(icon_location, *m_icon, m_icon->rect(), palette());
}
}
auto& font = is_checked() ? Gfx::Font::default_bold_font() : this->font();