mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-04 13:48:01 +02:00
refactor: move deleted tauri APIs, prepare for next release (#355)
This commit is contained in:
committed by
GitHub
parent
937e6a5be6
commit
702b7b36bd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user