simplify load_icon
This commit is contained in:
+6
-10
@@ -265,17 +265,13 @@ impl App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn load_icon() -> eframe::egui::IconData {
|
fn load_icon() -> eframe::egui::IconData {
|
||||||
let (icon_rgba, icon_width, icon_height) = {
|
let icon = include_bytes!("../assets/icon.png");
|
||||||
let icon = include_bytes!("../assets/icon.png");
|
let image = image::load_from_memory(icon).unwrap().into_rgba8();
|
||||||
let image = image::load_from_memory(icon).unwrap().into_rgba8();
|
let (width, height) = image.dimensions();
|
||||||
let (width, height) = image.dimensions();
|
|
||||||
let rgba = image.into_raw();
|
|
||||||
(rgba, width, height)
|
|
||||||
};
|
|
||||||
eframe::egui::IconData {
|
eframe::egui::IconData {
|
||||||
rgba: icon_rgba,
|
rgba: image.into_raw(),
|
||||||
width: icon_width,
|
width,
|
||||||
height: icon_height,
|
height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user