diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-05 16:53:30 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-05 16:53:30 +0200 |
commit | 00bdb74c84ed1d0b36eb2871a8aea8a6b0635f06 (patch) | |
tree | 22e30c11eb3d01c3904c48a4f030676ed8c90a0d | |
parent | 158f3b93629c1e27b06ebe26e81f259a6e51b1fe (diff) | |
download | serenity-00bdb74c84ed1d0b36eb2871a8aea8a6b0635f06.zip |
QuickShow: Allow copying the current bitmap to the clipboard :^)
-rw-r--r-- | Applications/QuickShow/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Applications/QuickShow/main.cpp b/Applications/QuickShow/main.cpp index 13a3aa0f88..22671684fe 100644 --- a/Applications/QuickShow/main.cpp +++ b/Applications/QuickShow/main.cpp @@ -32,6 +32,7 @@ #include <LibGUI/Action.h> #include <LibGUI/Application.h> #include <LibGUI/BoxLayout.h> +#include <LibGUI/Clipboard.h> #include <LibGUI/Desktop.h> #include <LibGUI/FilePicker.h> #include <LibGUI/Label.h> @@ -249,6 +250,11 @@ int main(int argc, char** argv) GUI::AboutDialog::show("QuickShow", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-image.png"), window); }); + auto copy_action = GUI::CommonActions::make_copy_action([&](auto&) { + if (widget.bitmap()) + GUI::Clipboard::the().set_bitmap(*widget.bitmap()); + }); + main_toolbar.add_action(open_action); main_toolbar.add_action(delete_action); main_toolbar.add_separator(); |