1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Add Context::copy_image (#5533)

* Closes https://github.com/emilk/egui/issues/5424

This adds support for copying images to the system clipboard on native
and on web using `Context::copy_image`.
This commit is contained in:
Emil Ernerfeldt
2024-12-29 18:03:32 +01:00
committed by GitHub
parent e2c7e9e733
commit bf6ed3adfc
15 changed files with 285 additions and 41 deletions

View File

@@ -36,11 +36,11 @@ android-game-activity = ["winit/android-game-activity"]
android-native-activity = ["winit/android-native-activity"]
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`egui::epaint::Vertex`], [`egui::Vec2`] etc to `&[u8]`.
bytemuck = ["egui/bytemuck"]
bytemuck = ["egui/bytemuck", "dep:bytemuck"]
## Enable cut/copy/paste to OS clipboard.
## If disabled a clipboard will be simulated so you can still copy/paste within the egui app.
clipboard = ["arboard", "smithay-clipboard"]
clipboard = ["arboard", "bytemuck", "smithay-clipboard"]
## Enable opening links in a browser when an egui hyperlink is clicked.
links = ["webbrowser"]
@@ -69,6 +69,8 @@ winit = { workspace = true, default-features = false }
# feature accesskit
accesskit_winit = { version = "0.23", optional = true }
bytemuck = { workspace = true, optional = true }
## Enable this when generating docs.
document-features = { workspace = true, optional = true }
@@ -84,4 +86,6 @@ smithay-clipboard = { version = "0.7.2", optional = true }
wayland-cursor = { version = "0.31.1", default-features = false, optional = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
arboard = { version = "3.3", optional = true, default-features = false }
arboard = { version = "3.3", optional = true, default-features = false, features = [
"image-data",
] }