mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibCore: Make Core::Object::add<ChildType> return a ChildType&
Since the returned object is now owned by the callee object, we can simply vend a ChildType&. This allows us to use "." instead of "->" at the call site, which is quite nice. :^)
This commit is contained in:
parent
fb09b6a8ce
commit
028c011760
46 changed files with 1035 additions and 1039 deletions
|
@ -57,11 +57,11 @@ StatusBar::~StatusBar()
|
|||
|
||||
NonnullRefPtr<Label> StatusBar::create_label()
|
||||
{
|
||||
auto label = add<Label>();
|
||||
label->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
label->set_frame_shape(Gfx::FrameShape::Panel);
|
||||
label->set_frame_thickness(1);
|
||||
label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
auto& label = add<Label>();
|
||||
label.set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
label.set_frame_shape(Gfx::FrameShape::Panel);
|
||||
label.set_frame_thickness(1);
|
||||
label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
return label;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue