Merge pull request #178 from hecrj/expose-winit-clipboard

Expose `iced_winit::Clipboard`
This commit is contained in:
Héctor Ramón 2020-02-03 21:25:36 -06:00 committed by GitHub
commit 12292126dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,12 @@
/// A buffer for short-term storage and transfer within and between
/// applications.
#[allow(missing_debug_implementations)]
pub struct Clipboard(window_clipboard::Clipboard); pub struct Clipboard(window_clipboard::Clipboard);
impl Clipboard { impl Clipboard {
/// Creates a new [`Clipboard`] for the given window.
///
/// [`Clipboard`]: struct.Clipboard.html
pub fn new(window: &winit::window::Window) -> Option<Clipboard> { pub fn new(window: &winit::window::Window) -> Option<Clipboard> {
window_clipboard::Clipboard::new(window).map(Clipboard).ok() window_clipboard::Clipboard::new(window).map(Clipboard).ok()
} }

View File

@ -43,9 +43,9 @@ mod debug;
mod debug; mod debug;
pub use application::Application; pub use application::Application;
pub use clipboard::Clipboard;
pub use mode::Mode; pub use mode::Mode;
pub use settings::Settings; pub use settings::Settings;
use clipboard::Clipboard;
use debug::Debug; use debug::Debug;
use proxy::Proxy; use proxy::Proxy;