1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:17:34 +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

@ -153,7 +153,7 @@ void TaskbarButton::paint_event(GUI::PaintEvent& event)
else
painter.blit(icon_location, icon, icon.rect());
} else {
painter.blit_dimmed(icon_location, icon, icon.rect());
painter.blit_disabled(icon_location, icon, icon.rect(), palette());
}
if (!has_progress)

View file

@ -255,7 +255,10 @@ void Menu::draw()
});
icon_rect.move_by(-1, -1);
}
painter.blit(icon_rect.location(), *item.icon(), item.icon()->rect());
if (item.is_enabled())
painter.blit(icon_rect.location(), *item.icon(), item.icon()->rect());
else
painter.blit_disabled(icon_rect.location(), *item.icon(), item.icon()->rect(), palette);
}
auto& previous_font = painter.font();
if (item.is_default())