clipboard: Use same ContentProvider as for D+D

FileList is working in more cases than PNGs and has fewer drawbacks.
Also, it's the same that has been used elsewhere for a long time.

Closes #50
This commit is contained in:
Sophie Herold 2023-01-24 01:51:59 +01:00 • committed by Christopher Davis
parent 4eb8b939b3
commit 7cf04d290a

View file

@ -582,11 +582,11 @@ impl LpImageView {
pub fn copy(&self) -> anyhow::Result<()> {
let clipboard = self.clipboard();
if let Some(texture) = self.current_page().context("No current page")?.texture() {
clipboard.set_texture(&texture);
} else {
anyhow::bail!("No Image displayed.");
}
let content_provider = self
.current_page()
.context("No current page")?
.content_provider();
clipboard.set_content(content_provider.as_ref())?;
Ok(())
}