Skip to content

Commit

Permalink
bump winit
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Nov 29, 2023
1 parent 58d5e4a commit d3ab706
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ floem_renderer = { path = "renderer" }
floem_vger = { path = "vger" }
floem_tiny_skia = { path = "tiny_skia" }
floem_reactive = { path = "reactive" }
winit = { git = "https://github.com/lapce/winit", rev = "7608048ad91efceb6d97d03dcd74b33c60cc2072", features = ["rwh_05"] }
winit = { git = "https://github.com/lapce/winit", rev = "e8c26d691a20a96c4e9d841d31fc315dabd5a5a1", features = ["rwh_05"] }
# winit = { path = "../winit", features = ["rwh_05"] }
image = { version = "0.24", features = ["jpeg", "png"] }
copypasta = { version = "0.10.0", default-features = false, features = ["wayland", "x11"] }
Expand Down
8 changes: 5 additions & 3 deletions examples/widget-gallery/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ pub fn clipboard_view() -> impl View {
(
form_item("Simple copy".to_string(), 120.0, move || {
button(|| "Copy the answer").on_click_stop(move |_| {
Clipboard::set_contents("42");
let _ = Clipboard::set_contents("42".to_string());
})
}),
form_item("Copy from input".to_string(), 120.0, move || {
h_stack((
text_input(text1).keyboard_navigatable(),
button(|| "Copy").on_click_stop(move |_| {
Clipboard::set_contents(&text1.get());
let _ = Clipboard::set_contents(text1.get());
}),
))
}),
form_item("Get clipboard".to_string(), 120.0, move || {
v_stack((
button(|| "Get clipboard").on_click_stop(move |_| {
text2.set(Clipboard::get_contents().unwrap());
if let Ok(content) = Clipboard::get_contents() {
text2.set(content);
}
}),
label(move || text2.get()),
))
Expand Down
1 change: 1 addition & 0 deletions src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct Clipboard {
selection: Option<Box<dyn ClipboardProvider>>,
}

#[derive(Clone, Debug)]
pub enum ClipboardError {
NotAvailable,
ProviderError(String),
Expand Down

0 comments on commit d3ab706

Please sign in to comment.