HackStudio: Propagate errors using try_set_main_widget

The documentation tooltip and parameters hint tooltip initialization
functions are now fallible and now call try_set_main_widget
instead of set_main_widget. They are only called by Editor's new
custom try_create function.
This commit is contained in:
creator1creeper1 2022-01-07 15:40:06 +01:00 committed by Andreas Kling
commit d4484f4de3
Notes: sideshowbarker 2024-07-17 21:21:45 +09:00
3 changed files with 21 additions and 10 deletions

View file

@ -30,7 +30,8 @@ EditorWrapper::EditorWrapper()
m_filename_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_filename_label->set_fixed_height(14);
m_editor = add<Editor>();
// FIXME: Propagate errors instead of giving up
m_editor = MUST(try_add<Editor>());
m_editor->set_ruler_visible(true);
m_editor->set_automatic_indentation_enabled(true);