mirror of
https://github.com/RGBCube/serenity
synced 2025-06-17 22:12:08 +00:00
Piano: Make menu bar consistent with other apps
"Help" should be after "Edit". The "Quit" menu item should be at the end of the app menu, and after a separator.
This commit is contained in:
parent
173effc88d
commit
2dd40aac4d
1 changed files with 8 additions and 7 deletions
|
@ -95,10 +95,6 @@ int main(int argc, char** argv)
|
||||||
auto menubar = GUI::MenuBar::construct();
|
auto menubar = GUI::MenuBar::construct();
|
||||||
|
|
||||||
auto& app_menu = menubar->add_menu("Piano");
|
auto& app_menu = menubar->add_menu("Piano");
|
||||||
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
|
||||||
GUI::Application::the()->quit();
|
|
||||||
return;
|
|
||||||
}));
|
|
||||||
app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) {
|
app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) {
|
||||||
save_path = GUI::FilePicker::get_save_filepath("Untitled", "wav");
|
save_path = GUI::FilePicker::get_save_filepath("Untitled", "wav");
|
||||||
if (!save_path.has_value())
|
if (!save_path.has_value())
|
||||||
|
@ -111,15 +107,20 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
need_to_write_wav = true;
|
need_to_write_wav = true;
|
||||||
}));
|
}));
|
||||||
|
app_menu.add_separator();
|
||||||
|
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
||||||
|
GUI::Application::the()->quit();
|
||||||
|
return;
|
||||||
|
}));
|
||||||
|
|
||||||
|
auto& edit_menu = menubar->add_menu("Edit");
|
||||||
|
main_widget.add_actions(edit_menu);
|
||||||
|
|
||||||
auto& help_menu = menubar->add_menu("Help");
|
auto& help_menu = menubar->add_menu("Help");
|
||||||
help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) {
|
help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) {
|
||||||
GUI::AboutDialog::show("Piano", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-piano.png"), window);
|
GUI::AboutDialog::show("Piano", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-piano.png"), window);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
auto& edit_menu = menubar->add_menu("Edit");
|
|
||||||
main_widget.add_actions(edit_menu);
|
|
||||||
|
|
||||||
app->set_menubar(move(menubar));
|
app->set_menubar(move(menubar));
|
||||||
|
|
||||||
return app->exec();
|
return app->exec();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue