Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add an attribute modifier for clipboard #631

Merged
merged 2 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/add-clipboard-attr-modifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Add `WebViewBuilder::with_clipboard`.
9 changes: 9 additions & 0 deletions src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,15 @@ impl<'a> WebViewBuilder<'a> {
self
}

/// Enables clipboard access for the page rendered on **Linux** and **Windows**.
///
/// macOS doesn't provide such method and is always enabled by default. But you still need to add menu
/// item accelerators to use shortcuts.
pub fn with_clipboard(mut self, clipboard: bool) -> Self {
self.webview.clipboard = clipboard;
self
}

/// Set a new window request handler to decide if incoming url is allowed to be opened.
///
/// The closure takes a `String` parameter as url and return `bool` to determine if the url can be
Expand Down