1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

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
parent 4c0b8a70e2
commit d4484f4de3
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);