mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:48:11 +00:00
QuickShow: Allow copying the current bitmap to the clipboard :^)
This commit is contained in:
parent
158f3b9362
commit
00bdb74c84
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue