1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 18:35:09 +00:00

FontEditor: Add a "Save" menu item

This commit is contained in:
Nico Weber 2020-07-10 21:23:44 -04:00 committed by Andreas Kling
parent 315dc8d81b
commit 97aaf95265

View file

@ -105,6 +105,10 @@ int main(int argc, char** argv)
set_edited_font(open_path.value(), move(new_font), window->position());
}));
app_menu.add_action(GUI::Action::create("Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"), [&](auto&) {
FontEditorWidget* editor = static_cast<FontEditorWidget*>(window->main_widget());
editor->save_as(editor->path());
}));
app_menu.add_action(GUI::Action::create("Save as...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"), [&](auto&) {
FontEditorWidget* editor = static_cast<FontEditorWidget*>(window->main_widget());
Optional<String> save_path = GUI::FilePicker::get_save_filepath(editor->path(), ".font");