summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/main.cpp
diff options
context:
space:
mode:
authorPierre <pierre.git@posteo.de>2021-01-22 11:55:26 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 20:39:25 +0100
commit8e265b512a3385b8494187e05132d7be90c4a340 (patch)
tree457dfd33f94455edac0ba7f5ff89150e79824605 /Userland/Applications/PixelPaint/main.cpp
parenta1d773960723dcd6395bef4c4e5eecf4fe3c68e3 (diff)
downloadserenity-8e265b512a3385b8494187e05132d7be90c4a340.zip
PixelPaint: adding an option to export as PNG
Diffstat (limited to 'Userland/Applications/PixelPaint/main.cpp')
-rw-r--r--Userland/Applications/PixelPaint/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp
index df581829e6..9c054a67dd 100644
--- a/Userland/Applications/PixelPaint/main.cpp
+++ b/Userland/Applications/PixelPaint/main.cpp
@@ -160,6 +160,20 @@ int main(int argc, char** argv)
image_editor.image()->export_bmp(save_path.value());
},
window));
+ export_submenu.add_action(
+ GUI::Action::create(
+ "As PNG", [&](auto&) {
+ if (!image_editor.image())
+ return;
+
+ Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png");
+
+ if (!save_path.has_value())
+ return;
+
+ image_editor.image()->export_png(save_path.value());
+ },
+ window));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {