mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibWeb: Simplify LayoutWidget layout
Set the intrinsic size up front and let LayoutReplaced do the work.
This commit is contained in:
parent
83cda9e79e
commit
11f2c59219
2 changed files with 4 additions and 11 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue