From 44b5b85ed948974c5679e50b4351f77720ef5483 Mon Sep 17 00:00:00 2001 From: keiya01 Date: Mon, 23 May 2022 09:07:20 +0900 Subject: [PATCH] fixup! feat: add find-in-page, closes #585 --- examples/find_in_page.rs | 1 + src/webview/webkitgtk/mod.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/find_in_page.rs b/examples/find_in_page.rs index 1543dcb5f7..bb77bc73c4 100644 --- a/examples/find_in_page.rs +++ b/examples/find_in_page.rs @@ -63,6 +63,7 @@ fn main() -> wry::Result<()> { text, FindInPageOption { case_sensitive: true, + max_match_count: 100, ..FindInPageOption::default() }, |found| println!("Is found: {}", found), diff --git a/src/webview/webkitgtk/mod.rs b/src/webview/webkitgtk/mod.rs index 0dfcd0fee9..b1d0e19659 100644 --- a/src/webview/webkitgtk/mod.rs +++ b/src/webview/webkitgtk/mod.rs @@ -297,7 +297,7 @@ impl InnerWebView { }; let find_controller = { - let mut builder = FindControllerBuilder::new(); + let builder = FindControllerBuilder::new(); let controller = builder.web_view(&*webview).build(); Rc::new(controller) }; @@ -424,10 +424,10 @@ impl InnerWebView { self .find_controller - .connect_failed_to_find_text(move |_| (*f)(false)); + .connect_failed_to_find_text(move |_| (*handler)(false)); self .find_controller - .connect_found_text(move |_, _| (*f)(true)); + .connect_found_text(move |_, _| (*found)(true)); } }