Skip to content

Commit

Permalink
Replace clipboard with clipboard_get and clipboard_set
Browse files Browse the repository at this point in the history
  • Loading branch information
tosti007 committed Jan 9, 2024
1 parent 4d1581a commit d595298
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@ impl State {
self.egui_input.max_texture_side = Some(max_texture_side);
}

/// Returns the used clipboard.
pub fn clipboard(&mut self) -> &mut clipboard::Clipboard {
&mut self.clipboard
/// Fetches text from the clipboard and returns it.
pub fn clipboard(&mut self) -> Option<String> {
self.clipboard.get()
}

/// Places the text onto the clipboard.
pub fn set_clipboard(&mut self, text: String) {
self.clipboard.set(text)
}

/// Returns [`false`] or the last value that [`Window::set_ime_allowed()`] was called with, used for debouncing.
Expand Down

0 comments on commit d595298

Please sign in to comment.