Explorar el Código

testing wry refactor

FabianLars hace 1 año
padre
commit
e1bc904fec
Se han modificado 3 ficheros con 9 adiciones y 10 borrados
  1. 1 2
      Cargo.lock
  2. 1 1
      core/tauri-runtime-wry/Cargo.toml
  3. 7 7
      core/tauri-runtime-wry/src/lib.rs

+ 1 - 2
Cargo.lock

@@ -4968,8 +4968,7 @@ dependencies = [
 [[package]]
 name = "wry"
 version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b717040ba9771fd88eb428c6ea6b555f8e734ff8534f02c13e8f10d97f5935e"
+source = "git+https://github.com/tauri-apps/wry?rev=549c6637b282443b7a08cb0069ccf372e297646a#549c6637b282443b7a08cb0069ccf372e297646a"
 dependencies = [
  "base64 0.21.7",
  "block",

+ 1 - 1
core/tauri-runtime-wry/Cargo.toml

@@ -13,7 +13,7 @@ edition = { workspace = true }
 rust-version = { workspace = true }
 
 [dependencies]
-wry = { version = "0.37", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
+wry = { git = "https://github.com/tauri-apps/wry", rev = "549c6637b282443b7a08cb0069ccf372e297646a", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
 tao = { version = "0.26", default-features = false, features = [ "rwh_06" ] }
 tauri-runtime = { version = "2.0.0-beta.9", path = "../tauri-runtime" }
 tauri-utils = { version = "2.0.0-beta.9", path = "../tauri-utils" }

+ 7 - 7
core/tauri-runtime-wry/src/lib.rs

@@ -2818,7 +2818,7 @@ fn handle_user_message<T: UserEvent>(
               log::error!("{}", e);
             }
           }
-          WebviewMessage::Navigate(url) => webview.load_url(url.as_str()),
+          WebviewMessage::Navigate(url) => webview.load_url(url.as_str()).unwrap(),
           WebviewMessage::Print => {
             let _ = webview.print();
           }
@@ -2831,7 +2831,7 @@ fn handle_user_message<T: UserEvent>(
             });
           }
           WebviewMessage::SetSize(size) => {
-            let mut bounds = webview.bounds();
+            let mut bounds = webview.bounds().unwrap();
             let size = size.to_logical(window.scale_factor());
             bounds.width = size.width;
             bounds.height = size.height;
@@ -2845,7 +2845,7 @@ fn handle_user_message<T: UserEvent>(
             webview.set_bounds(bounds);
           }
           WebviewMessage::SetPosition(position) => {
-            let mut bounds = webview.bounds();
+            let mut bounds = webview.bounds().unwrap();
             let position = position.to_logical(window.scale_factor());
             bounds.x = position.x;
             bounds.y = position.y;
@@ -2860,16 +2860,16 @@ fn handle_user_message<T: UserEvent>(
           }
           // Getters
           WebviewMessage::Url(tx) => {
-            tx.send(webview.url().parse().unwrap()).unwrap();
+            tx.send(webview.url().unwrap().parse().unwrap()).unwrap();
           }
           WebviewMessage::Position(tx) => {
-            let bounds = webview.bounds();
+            let bounds = webview.bounds().unwrap();
             let position =
               LogicalPosition::new(bounds.x, bounds.y).to_physical(window.scale_factor());
             tx.send(position).unwrap();
           }
           WebviewMessage::Size(tx) => {
-            let bounds = webview.bounds();
+            let bounds = webview.bounds().unwrap();
             let size =
               LogicalSize::new(bounds.width, bounds.height).to_physical(window.scale_factor());
             tx.send(size).unwrap();
@@ -2878,7 +2878,7 @@ fn handle_user_message<T: UserEvent>(
             webview.focus();
           }
           WebviewMessage::SetAutoResize(auto_resize) => {
-            let bounds = webview.bounds();
+            let bounds = webview.bounds().unwrap();
             let window_size = window.inner_size().to_logical::<f32>(window.scale_factor());
             *webview.bounds.lock().unwrap() = if auto_resize {
               Some(WebviewBounds {