mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
LibGUI: Make ToolBarContainer better at reacting to child events
Now you can remove a ToolBar from a ToolBarContainer and it will update its own preferred size automatically.
This commit is contained in:
@@ -35,20 +35,16 @@ class ToolBarContainer : public Frame {
|
||||
C_OBJECT(ToolBarContainer);
|
||||
|
||||
public:
|
||||
template<class T, class... Args>
|
||||
inline T& add(Args&&... args)
|
||||
{
|
||||
auto& child = Frame::add<T>(forward<Args>(args)...);
|
||||
did_add_toolbar(child);
|
||||
return child;
|
||||
}
|
||||
|
||||
private:
|
||||
explicit ToolBarContainer(Gfx::Orientation = Gfx::Orientation::Horizontal);
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void child_event(Core::ChildEvent&) override;
|
||||
|
||||
void did_add_toolbar(Widget&);
|
||||
void did_remove_toolbar(Widget&);
|
||||
void recompute_preferred_size();
|
||||
|
||||
Gfx::Orientation m_orientation { Gfx::Orientation::Horizontal };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user