From 59a3a74d7b829790138196dc62b57ff938f6e031 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Sun, 20 Nov 2022 12:26:09 +0800 Subject: [PATCH] feat: Allow navigating with gestures Resolved #81 --- src-tauri/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a1c7e1a..7a42abb 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -44,7 +44,7 @@ use wry::{ fn main() -> wry::Result<()> { - + #[cfg(target_os = "macos")] let mut menu_bar_menu = Menu::new(); #[cfg(target_os = "macos")] @@ -139,7 +139,7 @@ fn main() -> wry::Result<()> { let window = common_window .with_title("") .build(&event_loop) - .unwrap(); + .unwrap(); #[cfg(target_os = "macos")] let window = common_window @@ -165,12 +165,13 @@ fn main() -> wry::Result<()> { webbrowser::open(&href).expect("no browser"); } }; - + let webview = WebViewBuilder::new(window)? .with_url(&url.to_string())? .with_devtools(cfg!(feature = "devtools")) .with_initialization_script(include_str!("pake.js")) .with_ipc_handler(handler) + .with_back_forward_navigation_gestures(true) .build()?;