1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibDraw: Add MenuBaseText and MenuSelectionText color roles

This allows the very aesthetic "Hotdog Stand" theme to have quite
reasonable looking menus.
This commit is contained in:
Andreas Kling 2019-12-26 00:58:46 +01:00
parent 5330593e38
commit 5be6a43860
8 changed files with 17 additions and 42 deletions

View file

@ -154,11 +154,11 @@ void WSMenu::draw()
for (auto& item : m_items) {
if (item.type() == WSMenuItem::Text) {
Color text_color = palette.window_text();
Color text_color = palette.menu_base_text();
if (&item == m_hovered_item && item.is_enabled()) {
painter.fill_rect(item.rect(), palette.menu_selection());
painter.draw_rect(item.rect(), palette.menu_selection().darkened());
text_color = Color::White;
text_color = palette.menu_selection_text();
} else if (!item.is_enabled()) {
text_color = Color::MidGray;
}
@ -190,7 +190,7 @@ void WSMenu::draw()
s_submenu_arrow_bitmap_height
};
submenu_arrow_rect.center_vertically_within(item.rect());
painter.draw_bitmap(submenu_arrow_rect.location(), submenu_arrow_bitmap, palette.window_text());
painter.draw_bitmap(submenu_arrow_rect.location(), submenu_arrow_bitmap, text_color);
}
} else if (item.type() == WSMenuItem::Separator) {
Point p1(item.rect().translated(stripe_rect.width() + 4, 0).x(), item.rect().center().y() - 1);