simplify load_icon

This commit is contained in:
2025-04-08 06:35:15 +01:00
parent 9331f79038
commit 6e3aa70398
+6 -10
View File
@@ -265,17 +265,13 @@ impl App {
}
fn load_icon() -> eframe::egui::IconData {
let (icon_rgba, icon_width, icon_height) = {
let icon = include_bytes!("../assets/icon.png");
let image = image::load_from_memory(icon).unwrap().into_rgba8();
let (width, height) = image.dimensions();
let rgba = image.into_raw();
(rgba, width, height)
};
let icon = include_bytes!("../assets/icon.png");
let image = image::load_from_memory(icon).unwrap().into_rgba8();
let (width, height) = image.dimensions();
eframe::egui::IconData {
rgba: icon_rgba,
width: icon_width,
height: icon_height,
rgba: image.into_raw(),
width,
height,
}
}