mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Simplify LayoutWidget layout
Set the intrinsic size up front and let LayoutReplaced do the work.
This commit is contained in:
@@ -40,6 +40,10 @@ LayoutWidget::LayoutWidget(const Element& element, GUI::Widget& widget)
|
||||
: LayoutReplaced(element, StyleProperties::create())
|
||||
, m_widget(widget)
|
||||
{
|
||||
set_has_intrinsic_width(true);
|
||||
set_has_intrinsic_height(true);
|
||||
set_intrinsic_width(widget.width());
|
||||
set_intrinsic_height(widget.height());
|
||||
}
|
||||
|
||||
LayoutWidget::~LayoutWidget()
|
||||
@@ -47,16 +51,6 @@ LayoutWidget::~LayoutWidget()
|
||||
widget().remove_from_parent();
|
||||
}
|
||||
|
||||
void LayoutWidget::layout(LayoutMode layout_mode)
|
||||
{
|
||||
set_has_intrinsic_width(true);
|
||||
set_has_intrinsic_height(true);
|
||||
set_intrinsic_width(widget().width());
|
||||
set_intrinsic_height(widget().height());
|
||||
|
||||
LayoutReplaced::layout(layout_mode);
|
||||
}
|
||||
|
||||
void LayoutWidget::did_set_rect()
|
||||
{
|
||||
LayoutReplaced::did_set_rect();
|
||||
|
||||
Reference in New Issue
Block a user