2023-12-17 23:14:55 +00:00
|
|
|
use dioxus::prelude::*;
|
2024-01-06 02:08:04 +00:00
|
|
|
use dioxus_desktop::{use_asset_handler, wry::http::Response};
|
2023-12-17 23:14:55 +00:00
|
|
|
|
|
|
|
fn main() {
|
2024-01-16 17:45:02 +00:00
|
|
|
launch_desktop(app);
|
2023-12-17 23:14:55 +00:00
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn app() -> Element {
|
|
|
|
use_asset_handler("logos", |request, response| {
|
2024-01-06 02:08:04 +00:00
|
|
|
// Note that the "logos" prefix is stripped from the URI
|
|
|
|
//
|
|
|
|
// However, the asset is absolute to its "virtual folder" - meaning it starts with a leading slash
|
|
|
|
if request.uri().path() != "/logo.png" {
|
|
|
|
return;
|
2023-12-17 23:14:55 +00:00
|
|
|
}
|
2024-01-06 02:08:04 +00:00
|
|
|
|
|
|
|
response.respond(Response::new(include_bytes!("./assets/logo.png").to_vec()));
|
2023-12-17 23:14:55 +00:00
|
|
|
});
|
|
|
|
|
2024-01-16 19:18:46 +00:00
|
|
|
rsx! {
|
2023-12-17 23:14:55 +00:00
|
|
|
div {
|
2024-01-11 20:11:27 +00:00
|
|
|
img { src: "/logos/logo.png" }
|
2023-12-17 23:14:55 +00:00
|
|
|
}
|
2024-01-11 20:11:27 +00:00
|
|
|
}
|
2023-12-17 23:14:55 +00:00
|
|
|
}
|