wip: native file handles when dropping 🎉

This commit is contained in:
Jonathan Kelley committed 2024-03-05 13:57:28 -08:00
1 parent 403e8e2f49
commit 78d16536a7
11 files changed
+134 -76

No files matched your search

+12 -1
View File
@@ -2,7 +2,8 @@
use dioxus_html::{native_bind::NativeFileEngine, FileEngine, HasFileData, HasFormData};
use serde::Deserialize;
use std::{path::PathBuf, str::FromStr, sync::Arc};
use std::{cell::Cell, path::PathBuf, rc::Rc, str::FromStr, sync::Arc};
use wry::FileDropEvent;
#[derive(Debug, Deserialize)]
pub(crate) struct FileDialogRequest {
@@ -142,3 +143,13 @@ impl HasFormData for DesktopFileUploadForm {
self
}
}
#[derive(Default, Clone)]
pub struct NativeFileHover {
event: Rc<Cell<Option<FileDropEvent>>>,
}
impl NativeFileHover {
pub fn set(&self, event: FileDropEvent) {
self.event.set(Some(event));
}
}