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:
parent
0782c60fe5
commit
29669ba661
1 changed files with 5 additions and 0 deletions
|
@ -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();
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue