Skip to content

Commit

Permalink
fix: Add WebViewBuilder::with_clipboard(#631)
Browse files Browse the repository at this point in the history
* fix: Add an attribute modifier for `clipboard`
  • Loading branch information
bg5hfc authored Jul 5, 2022
1 parent 9d42419 commit c798700
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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

0 comments on commit c798700

Please sign in to comment.