mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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
|
@ -248,10 +248,10 @@ int main(int argc, char** argv)
|
|||
|
||||
auto& fire = window->set_main_widget<Fire>();
|
||||
|
||||
auto time = fire.add<GUI::Label>();
|
||||
time->set_relative_rect({ 0, 4, 40, 10 });
|
||||
time->move_by({ window->width() - time->width(), 0 });
|
||||
time->set_foreground_color(Color::from_rgb(0x444444));
|
||||
auto& time = fire.add<GUI::Label>();
|
||||
time.set_relative_rect({ 0, 4, 40, 10 });
|
||||
time.move_by({ window->width() - time.width(), 0 });
|
||||
time.set_foreground_color(Color::from_rgb(0x444444));
|
||||
fire.set_stat_label(time);
|
||||
|
||||
window->show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue