feat: allow customizing the index and head

This commit is contained in:
Jonathan Kelley committed 2022-04-16 16:53:47 -04:00
1 parent ab4f75e4ea
commit 049976d23a
6 files changed
+107 -12

No files matched your search

+8 -2
View File
@@ -125,8 +125,9 @@ pub fn launch_with_props<P: 'static + Send>(
let proxy = proxy.clone();
let file_handler = cfg.file_drop_handler.take();
let custom_head = cfg.custom_head.clone();
let resource_dir = cfg.resource_dir.clone();
let index_file = cfg.custom_index.clone();
let mut webview = WebViewBuilder::new(window)
.unwrap()
@@ -164,7 +165,12 @@ pub fn launch_with_props<P: 'static + Send>(
});
})
.with_custom_protocol(String::from("dioxus"), move |r| {
protocol::desktop_handler(r, resource_dir.clone())
protocol::desktop_handler(
r,
resource_dir.clone(),
custom_head.clone(),
index_file.clone(),
)
})
.with_file_drop_handler(move |window, evet| {
file_handler