summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-11 11:26:25 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-11 11:53:38 +0100
commitf4fa7589591878f1df8902f466f1fc6ea0e31e4a (patch)
tree571ee67813ba7de3e7d076a5a19f1bf052bc2c55 /Libraries
parent7aa62665a304be74b780f91cf8b06c8fd9203e2a (diff)
downloadserenity-f4fa7589591878f1df8902f466f1fc6ea0e31e4a.zip
LibGUI: Add a Widget::did_layout() that gets called after layout
This will allow widgets to implement post-layout behaviors.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/Widget.cpp1
-rw-r--r--Libraries/LibGUI/Widget.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Widget.cpp b/Libraries/LibGUI/Widget.cpp
index 5ca0d6d707..b4b2ccc084 100644
--- a/Libraries/LibGUI/Widget.cpp
+++ b/Libraries/LibGUI/Widget.cpp
@@ -245,6 +245,7 @@ void Widget::do_layout()
if (!m_layout)
return;
m_layout->run(*this);
+ did_layout();
update();
}
diff --git a/Libraries/LibGUI/Widget.h b/Libraries/LibGUI/Widget.h
index ef2af59fdc..9ecb8fe8c1 100644
--- a/Libraries/LibGUI/Widget.h
+++ b/Libraries/LibGUI/Widget.h
@@ -283,6 +283,7 @@ protected:
virtual void custom_layout() {}
virtual void did_change_font() {}
+ virtual void did_layout() {}
virtual void paint_event(PaintEvent&);
virtual void resize_event(ResizeEvent&);
virtual void show_event(ShowEvent&);