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

@ -83,6 +83,7 @@ public:
virtual void blur();
virtual void on_blur();
bool focusable() const;
void set_focusable(const bool value);
bool has_focus();
virtual Widget* last_child_focus() const;
virtual void set_last_child_focus(Widget* const child);
@ -110,12 +111,18 @@ public:
void visible(bool v);
bool highlighted() const;
void set_highlighted(const bool value);
protected:
/* Widget rectangle relative to parent pos(). */
Rect parent_rect;
const Style* style_ { nullptr };
Widget* parent_ { nullptr };
void dirty_overlapping_children_in_rect(const Rect& child_rect);
private:
struct flags_t {
bool dirty : 1; // Widget content has changed.
bool hidden : 1; // Hide widget and children.
@ -131,8 +138,6 @@ protected:
.highlighted = false,
.visible = false,
};
void dirty_overlapping_children_in_rect(const Rect& child_rect);
};
class View : public Widget {