diff options
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1028,6 +1028,21 @@ fn find_hoardom() -> PathBuf { PathBuf::from("hoardom") } +// ----- load app icon ----- + +fn load_icon() -> egui::IconData { + let png_bytes = include_bytes!("../dist/AppIcon.png"); + let img = image::load_from_memory_with_format(png_bytes, image::ImageFormat::Png) + .expect("failed to decode embedded icon") + .into_rgba8(); + let (w, h) = img.dimensions(); + egui::IconData { + rgba: img.into_raw(), + width: w, + height: h, + } +} + // ----- main ----- fn main() -> eframe::Result<()> { @@ -1124,7 +1139,8 @@ fn main() -> eframe::Result<()> { viewport: egui::ViewportBuilder::default() .with_title("hoardom") .with_inner_size([est_width, est_height]) - .with_min_inner_size([300.0, 200.0]), + .with_min_inner_size([300.0, 200.0]) + .with_icon(load_icon()), ..Default::default() }; |
