mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibCore+LibGUI: Make CObject child events synchronous.
...and then make GWidget layout invalidation lazy. This way we coalesce multiple invalidations into a single relayout and we don't have to worry about child widgets not being fully constructed.
This commit is contained in:
parent
0e6b273620
commit
9e6b0ccc0e
4 changed files with 22 additions and 13 deletions
|
@ -10,7 +10,7 @@ class CTimerEvent;
|
|||
|
||||
class CObject : public Weakable<CObject> {
|
||||
public:
|
||||
CObject(CObject* parent = nullptr);
|
||||
CObject(CObject* parent = nullptr, bool is_widget = false);
|
||||
virtual ~CObject();
|
||||
|
||||
virtual const char* class_name() const { return "CObject"; }
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
void deferred_invoke(Function<void(CObject&)>);
|
||||
|
||||
virtual bool is_widget() const { return false; }
|
||||
bool is_widget() const { return m_widget; }
|
||||
virtual bool is_window() const { return false; }
|
||||
|
||||
protected:
|
||||
|
@ -46,5 +46,6 @@ protected:
|
|||
private:
|
||||
CObject* m_parent { nullptr };
|
||||
int m_timer_id { 0 };
|
||||
bool m_widget { false };
|
||||
Vector<CObject*> m_children;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue