mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibGUI: Add Widget::add_spacer() wrapper
This just calls Layout::try_add_spacer(), but saves you having to access the Widget's Layout directly. We verify that the Widget has a Layout, since it would be a programming error if we tried to do so without one.
This commit is contained in:
parent
6ceb185865
commit
ab6ef53247
Notes:
sideshowbarker
2024-07-17 20:33:50 +09:00
Author: https://github.com/AtkinsSJ
Commit: ab6ef53247
Pull-request: https://github.com/SerenityOS/serenity/pull/17495
Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 8 additions and 0 deletions
|
@ -1266,4 +1266,10 @@ bool Widget::is_visible_for_timer_purposes() const
|
|||
return is_visible() && Object::is_visible_for_timer_purposes();
|
||||
}
|
||||
|
||||
ErrorOr<void> Widget::add_spacer()
|
||||
{
|
||||
VERIFY(layout());
|
||||
return layout()->try_add_spacer();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue