mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +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
|
@ -51,7 +51,7 @@ TextEditorWidget::TextEditorWidget()
|
|||
set_layout<GUI::VerticalBoxLayout>();
|
||||
layout()->set_spacing(0);
|
||||
|
||||
auto toolbar = add<GUI::ToolBar>();
|
||||
auto& toolbar = add<GUI::ToolBar>();
|
||||
m_editor = add<GUI::TextEditor>();
|
||||
m_editor->set_ruler_visible(true);
|
||||
m_editor->set_automatic_indentation_enabled(true);
|
||||
|
@ -391,21 +391,21 @@ TextEditorWidget::TextEditorWidget()
|
|||
|
||||
GUI::Application::the().set_menubar(move(menubar));
|
||||
|
||||
toolbar->add_action(*m_new_action);
|
||||
toolbar->add_action(*m_open_action);
|
||||
toolbar->add_action(*m_save_action);
|
||||
toolbar.add_action(*m_new_action);
|
||||
toolbar.add_action(*m_open_action);
|
||||
toolbar.add_action(*m_save_action);
|
||||
|
||||
toolbar->add_separator();
|
||||
toolbar.add_separator();
|
||||
|
||||
toolbar->add_action(m_editor->cut_action());
|
||||
toolbar->add_action(m_editor->copy_action());
|
||||
toolbar->add_action(m_editor->paste_action());
|
||||
toolbar->add_action(m_editor->delete_action());
|
||||
toolbar.add_action(m_editor->cut_action());
|
||||
toolbar.add_action(m_editor->copy_action());
|
||||
toolbar.add_action(m_editor->paste_action());
|
||||
toolbar.add_action(m_editor->delete_action());
|
||||
|
||||
toolbar->add_separator();
|
||||
toolbar.add_separator();
|
||||
|
||||
toolbar->add_action(m_editor->undo_action());
|
||||
toolbar->add_action(m_editor->redo_action());
|
||||
toolbar.add_action(m_editor->undo_action());
|
||||
toolbar.add_action(m_editor->redo_action());
|
||||
}
|
||||
|
||||
TextEditorWidget::~TextEditorWidget()
|
||||
|
|
|
@ -69,11 +69,11 @@ private:
|
|||
|
||||
RefPtr<GUI::TextBox> m_find_textbox;
|
||||
RefPtr<GUI::TextBox> m_replace_textbox;
|
||||
GUI::Button* m_find_previous_button { nullptr };
|
||||
GUI::Button* m_find_next_button { nullptr };
|
||||
GUI::Button* m_replace_previous_button { nullptr };
|
||||
GUI::Button* m_replace_next_button { nullptr };
|
||||
GUI::Button* m_replace_all_button { nullptr };
|
||||
RefPtr<GUI::Button> m_find_previous_button;
|
||||
RefPtr<GUI::Button> m_find_next_button;
|
||||
RefPtr<GUI::Button> m_replace_previous_button;
|
||||
RefPtr<GUI::Button> m_replace_next_button;
|
||||
RefPtr<GUI::Button> m_replace_all_button;
|
||||
RefPtr<GUI::Widget> m_find_replace_widget;
|
||||
RefPtr<GUI::Widget> m_find_widget;
|
||||
RefPtr<GUI::Widget> m_replace_widget;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue