mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore: update to tauri beta.3
This commit is contained in:
@@ -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) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user