mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 09:18:05 +03:00
QuickShow: Allow copying the current bitmap to the clipboard :^)
This commit is contained in:
parent
158f3b9362
commit
00bdb74c84
Notes:
sideshowbarker
2024-07-19 02:54:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/00bdb74c84e
@ -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…
Reference in New Issue
Block a user