simplify load_icon
This commit is contained in:
+3
-7
@@ -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)
|
||||
};
|
||||
eframe::egui::IconData {
|
||||
rgba: icon_rgba,
|
||||
width: icon_width,
|
||||
height: icon_height,
|
||||
rgba: image.into_raw(),
|
||||
width,
|
||||
height,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user