diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 15:43:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 15:46:47 +0200 |
commit | 93851c3832bb59259309ede0465be056a706df3e (patch) | |
tree | 4157375673d1b839ea5a84409bd22204744c89da /Applications/TextEditor | |
parent | 4ea229accdac70e418af8f3f6d57cb5797d5dfad (diff) | |
download | serenity-93851c3832bb59259309ede0465be056a706df3e.zip |
LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtr
Diffstat (limited to 'Applications/TextEditor')
-rw-r--r-- | Applications/TextEditor/TextEditorWidget.cpp | 4 | ||||
-rw-r--r-- | Applications/TextEditor/TextEditorWidget.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 05f72be383..c98fc39d32 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -22,7 +22,7 @@ TextEditorWidget::TextEditorWidget() layout()->set_spacing(0); auto* toolbar = new GToolBar(this); - m_editor = new GTextEditor(GTextEditor::MultiLine, this); + m_editor = GTextEditor::construct(GTextEditor::MultiLine, this); m_editor->set_ruler_visible(true); m_editor->set_automatic_indentation_enabled(true); m_editor->set_line_wrapping_enabled(true); @@ -42,7 +42,7 @@ TextEditorWidget::TextEditorWidget() m_find_widget->layout()->set_margins({ 2, 2, 2, 2 }); m_find_widget->set_visible(false); - m_find_textbox = new GTextBox(m_find_widget); + m_find_textbox = GTextBox::construct(m_find_widget); m_find_next_action = GAction::create("Find next", { Mod_Ctrl, Key_G }, [&](auto&) { auto needle = m_find_textbox->text(); diff --git a/Applications/TextEditor/TextEditorWidget.h b/Applications/TextEditor/TextEditorWidget.h index aafc6c8367..304f92a31e 100644 --- a/Applications/TextEditor/TextEditorWidget.h +++ b/Applications/TextEditor/TextEditorWidget.h @@ -22,7 +22,7 @@ private: void set_path(const FileSystemPath& file); void update_title(); - GTextEditor* m_editor { nullptr }; + ObjectPtr<GTextEditor> m_editor; String m_path; String m_name; String m_extension; @@ -35,7 +35,7 @@ private: RefPtr<GAction> m_find_next_action; RefPtr<GAction> m_find_previous_action; - GTextBox* m_find_textbox { nullptr }; + ObjectPtr<GTextBox> m_find_textbox; GButton* m_find_previous_button { nullptr }; GButton* m_find_next_button { nullptr }; GWidget* m_find_widget { nullptr }; |