mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibGUI: Allow specifying Layout margins and spacing in the constructor
This is comfier than `my_widget->layout()->set_margins(...)`.
This commit is contained in:
parent
ab6ef53247
commit
43dddafd16
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/AtkinsSJ
Commit: 43dddafd16
Pull-request: https://github.com/SerenityOS/serenity/pull/17495
Reviewed-by: https://github.com/awesomekling ✅
4 changed files with 14 additions and 10 deletions
|
@ -17,8 +17,9 @@ REGISTER_LAYOUT(GUI, VerticalBoxLayout)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
BoxLayout::BoxLayout(Orientation orientation)
|
||||
: m_orientation(orientation)
|
||||
BoxLayout::BoxLayout(Orientation orientation, Margins margins, int spacing)
|
||||
: Layout(margins, spacing)
|
||||
, m_orientation(orientation)
|
||||
{
|
||||
register_property(
|
||||
"orientation", [this] { return m_orientation == Gfx::Orientation::Vertical ? "Vertical" : "Horizontal"; }, nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue