diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-27 11:10:37 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-27 11:10:37 +0100 |
commit | 6817d0701e9f3227fe15b46dd02a96c8ec79a390 (patch) | |
tree | 308c27df9b7f66f3e5ecab6055db31d66eb6ab6d /Userland/Applications | |
parent | 28720e90352185a42c9c2f9fd507d8207b3a8ab9 (diff) | |
download | serenity-6817d0701e9f3227fe15b46dd02a96c8ec79a390.zip |
TextEditor: Initialize menubar before opening initial file
Otherwise we can't toggle the syntax highlighting actions based on the
opened file (since the actions have not been created yet.)
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/TextEditor/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index 676c4dfa4e..0844f10232 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -82,15 +82,15 @@ int main(int argc, char** argv) return 1; } + auto menubar = GUI::MenuBar::construct(); + text_widget.initialize_menubar(menubar); + app->set_menubar(menubar); + if (file_to_edit) text_widget.open_file(file_to_edit); else text_widget.update_title(); - auto menubar = GUI::MenuBar::construct(); - text_widget.initialize_menubar(menubar); - app->set_menubar(menubar); - window->show(); window->set_icon(app_icon.bitmap_for_size(16)); |