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<()> { pub fn copy(&self) -> anyhow::Result<()> {
let clipboard = self.clipboard(); let clipboard = self.clipboard();
if let Some(texture) = self.current_page().context("No current page")?.texture() { let content_provider = self
clipboard.set_texture(&texture); .current_page()
} else { .context("No current page")?
anyhow::bail!("No Image displayed."); .content_provider();
} clipboard.set_content(content_provider.as_ref())?;
Ok(()) Ok(())
} }