Make Widget flags private, expose via methods.

This commit is contained in:
Jared Boone 2016-02-07 10:32:38 -08:00
parent 9a33fc884a
commit 7cb3bbc9f8
6 changed files with 37 additions and 25 deletions

View file

@ -32,17 +32,19 @@ void MenuItemView::select() {
}
void MenuItemView::highlight() {
set_highlight(true);
set_highlighted(true);
set_dirty();
}
void MenuItemView::unhighlight() {
set_highlight(false);
set_highlighted(false);
set_dirty();
}
void MenuItemView::paint(Painter& painter) {
const auto r = screen_rect();
const auto paint_style = (flags.highlighted && parent()->has_focus()) ? style().invert() : style();
const auto paint_style = (highlighted() && parent()->has_focus()) ? style().invert() : style();
const auto font_height = paint_style.font.line_height();
@ -58,11 +60,6 @@ void MenuItemView::paint(Painter& painter) {
);
}
void MenuItemView::set_highlight(const bool value) {
flags.highlighted = value;
set_dirty();
}
/* MenuView **************************************************************/
MenuView::~MenuView() {