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:
parent
4eb8b939b3
commit
7cf04d290a
1 changed files with 5 additions and 5 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue