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.)
This commit is contained in:
Andreas Kling 2021-02-27 11:10:37 +01:00
parent 28720e9035
commit 6817d0701e

View file

@ -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));