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

HackStudio: Add a simple "Save" action

Pressing Ctrl+S now saves the currently open file to disk.
This commit is contained in:
Andreas Kling 2019-10-22 22:25:05 +02:00
parent 0782c60fe5
commit 29669ba661

View file

@ -95,6 +95,11 @@ int main(int argc, char** argv)
auto menubar = make<GMenuBar>();
auto app_menu = make<GMenu>("HackStudio");
app_menu->add_action(GAction::create("Save", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file("/res/icons/16x16/save.png"), [&](auto&) {
if (g_currently_open_file.is_empty())
return;
text_editor->write_to_file(g_currently_open_file);
}));
app_menu->add_action(GCommonActions::make_quit_action([&](auto&) {
app.quit();
}));