refactor: move deleted tauri APIs, prepare for next release (#355)

This commit is contained in:
Lucas Fernandes Nogueira
2023-05-13 08:32:30 -07:00
committed by GitHub
parent 937e6a5be6
commit 702b7b36bd
45 changed files with 1412 additions and 31963 deletions
+13 -4
View File
@@ -10,6 +10,7 @@
use std::path::PathBuf;
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime};
@@ -101,6 +102,14 @@ impl From<MessageDialogKind> for rfd::MessageLevel {
}
}
struct WindowHandle(RawWindowHandle);
unsafe impl HasRawWindowHandle for WindowHandle {
fn raw_window_handle(&self) -> RawWindowHandle {
self.0
}
}
impl<R: Runtime> From<FileDialogBuilder<R>> for FileDialog {
fn from(d: FileDialogBuilder<R>) -> Self {
let mut builder = FileDialog::new();
@@ -119,8 +128,8 @@ impl<R: Runtime> From<FileDialogBuilder<R>> for FileDialog {
builder = builder.add_filter(&filter.name, &v);
}
#[cfg(desktop)]
if let Some(_parent) = d.parent {
// TODO builder = builder.set_parent(&parent);
if let Some(parent) = d.parent {
builder = builder.set_parent(&WindowHandle(parent));
}
builder
@@ -144,8 +153,8 @@ impl<R: Runtime> From<MessageDialogBuilder<R>> for rfd::MessageDialog {
dialog = dialog.set_buttons(buttons);
}
if let Some(_parent) = d.parent {
// TODO dialog.set_parent(parent);
if let Some(parent) = d.parent {
dialog = dialog.set_parent(&WindowHandle(parent));
}
dialog