1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:47:37 +00:00

WindowServer: More work on menus.

This commit is contained in:
Andreas Kling 2019-02-11 10:08:37 +01:00
parent 443b043b49
commit 5f288014d4
11 changed files with 51 additions and 33 deletions

View file

@ -37,9 +37,9 @@ void GButton::paint_event(GPaintEvent&)
}
if (m_icon) {
painter.blit_with_alpha(icon_location, *m_icon, m_icon->rect());
painter.draw_text(content_rect, caption(), Painter::TextAlignment::Center, Color::Black);
painter.draw_text(content_rect, caption(), TextAlignment::Center, Color::Black);
} else {
painter.draw_text(content_rect, caption(), Painter::TextAlignment::Center, Color::Black);
painter.draw_text(content_rect, caption(), TextAlignment::Center, Color::Black);
}
}
}

View file

@ -75,7 +75,7 @@ void GCheckBox::paint_event(GPaintEvent&)
painter.draw_bitmap(box_rect.shrunken(2, 2).location(), *s_checked_bitmap, foreground_color());
if (!caption().is_empty())
painter.draw_text(text_rect, caption(), Painter::TextAlignment::TopLeft, foreground_color());
painter.draw_text(text_rect, caption(), TextAlignment::TopLeft, foreground_color());
if (is_focused()) {
// NOTE: Painter::draw_focus_rect() will shrink(2,2) the passed rect.

View file

@ -24,5 +24,5 @@ void GLabel::paint_event(GPaintEvent& event)
if (fill_with_background_color())
painter.fill_rect({ 0, 0, width(), height() }, background_color());
if (!text().is_empty())
painter.draw_text({ 4, 4, width(), height() }, text(), Painter::TextAlignment::TopLeft, foreground_color());
painter.draw_text({ 4, 4, width(), height() }, text(), TextAlignment::TopLeft, foreground_color());
}

View file

@ -39,7 +39,7 @@ void GListBox::paint_event(GPaintEvent&)
painter.fill_rect(item_rect, Color(96, 96, 96));
item_text_color = Color::White;
}
painter.draw_text(item_rect, m_items[i], Painter::TextAlignment::TopLeft, item_text_color);
painter.draw_text(item_rect, m_items[i], TextAlignment::TopLeft, item_text_color);
}
}