1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

GWidget: Add "enabled" state for widgets.

There's nothing magical that happens for painting, each widget needs to
handle it manually in their painting code.
This commit is contained in:
Andreas Kling 2019-04-12 02:51:16 +02:00
parent a1015840ff
commit 269886fc4e
2 changed files with 12 additions and 0 deletions

View file

@ -38,6 +38,9 @@ public:
String tooltip() const { return m_tooltip; }
void set_tooltip(const String& tooltip) { m_tooltip = tooltip; }
bool is_enabled() const { return m_enabled; }
void set_enabled(bool);
virtual void event(CEvent&) override;
virtual void paint_event(GPaintEvent&);
virtual void resize_event(GResizeEvent&);
@ -180,6 +183,7 @@ private:
bool m_fill_with_background_color { false };
bool m_visible { true };
bool m_greedy_for_hits { false };
bool m_enabled { true };
CElapsedTimer m_click_clock;
};