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

LibGUI: Allow extra metadata when copying bitmaps to the clipboard

This commit is contained in:
Tim Ledbetter 2023-01-16 17:35:24 +00:00 committed by Jelle Raaijmakers
parent d6ddca0c0f
commit 112035d5c3
2 changed files with 3 additions and 3 deletions

View file

@ -137,9 +137,9 @@ void Clipboard::set_data(ReadonlyBytes data, DeprecatedString const& type, HashM
connection().async_set_clipboard_data(move(buffer), type, metadata);
}
void Clipboard::set_bitmap(Gfx::Bitmap const& bitmap)
void Clipboard::set_bitmap(Gfx::Bitmap const& bitmap, HashMap<DeprecatedString, DeprecatedString> const& additional_metadata)
{
HashMap<DeprecatedString, DeprecatedString> metadata;
HashMap<DeprecatedString, DeprecatedString> metadata(additional_metadata);
metadata.set("width", DeprecatedString::number(bitmap.width()));
metadata.set("height", DeprecatedString::number(bitmap.height()));
metadata.set("scale", DeprecatedString::number(bitmap.scale()));