1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

GCommonActions: Add "Open..." action

Make use of this in PaintBrush and TextEditor. :^)
This commit is contained in:
Andreas Kling 2019-09-20 19:36:39 +02:00
parent 48b1b55629
commit 74c4e62659
4 changed files with 8 additions and 2 deletions

View file

@ -44,7 +44,7 @@ int main(int argc, char** argv)
menubar->add_menu(move(app_menu));
auto file_menu = make<GMenu>("File");
file_menu->add_action(GAction::create("Open...", { Mod_Ctrl, Key_O }, [&](auto&) {
file_menu->add_action(GCommonActions::make_open_action([&](auto&) {
GFilePicker picker;
if (picker.exec() == GFilePicker::ExecOK) {
auto filename = picker.selected_file().string();