chore: update to tauri beta.3

This commit is contained in:
Lucas Nogueira
2024-02-19 17:05:15 -03:00
parent 8645a02aee
commit 8461cf1d1b
57 changed files with 4989 additions and 1203 deletions
+2 -2
View File
@@ -28,5 +28,5 @@ tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.0" }
glib = "0.16"
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
rfd = { version = "=0.12.0", features = [ "gtk3", "common-controls-v6" ] }
raw-window-handle = "0.5"
rfd = { git = "https://github.com/PolyMeilex/rfd", rev = "a88718eba75a70ee24753b3fa02e08f56b21670b", features = [ "gtk3", "common-controls-v6" ] }
raw-window-handle = "0.6"
+1 -1
View File
@@ -23,6 +23,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-beta.0"
"@tauri-apps/api": "2.0.0-beta.1"
}
}
+6 -4
View File
@@ -10,7 +10,7 @@
use std::path::PathBuf;
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime};
@@ -97,9 +97,11 @@ impl From<MessageDialogKind> for rfd::MessageLevel {
struct WindowHandle(RawWindowHandle);
unsafe impl HasRawWindowHandle for WindowHandle {
fn raw_window_handle(&self) -> RawWindowHandle {
self.0
impl HasWindowHandle for WindowHandle {
fn window_handle(
&self,
) -> Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
Ok(unsafe { raw_window_handle::WindowHandle::borrow_raw(self.0) })
}
}
+8 -4
View File
@@ -178,8 +178,10 @@ impl<R: Runtime> MessageDialogBuilder<R> {
///
/// - **Linux:** Unsupported.
#[cfg(desktop)]
pub fn parent<W: raw_window_handle::HasRawWindowHandle>(mut self, parent: &W) -> Self {
self.parent.replace(parent.raw_window_handle());
pub fn parent<W: raw_window_handle::HasWindowHandle>(mut self, parent: &W) -> Self {
if let Ok(h) = parent.window_handle() {
self.parent.replace(h.as_raw());
}
self
}
@@ -329,8 +331,10 @@ impl<R: Runtime> FileDialogBuilder<R> {
/// Sets the parent window of the dialog.
#[cfg(desktop)]
#[must_use]
pub fn set_parent<W: raw_window_handle::HasRawWindowHandle>(mut self, parent: &W) -> Self {
self.parent.replace(parent.raw_window_handle());
pub fn set_parent<W: raw_window_handle::HasWindowHandle>(mut self, parent: &W) -> Self {
if let Ok(h) = parent.window_handle() {
self.parent.replace(h.as_raw());
}
self
}