diff options
| author | UMTS at Teleco <crt@teleco.ch> | 2026-03-08 15:57:23 +0100 |
|---|---|---|
| committer | UMTS at Teleco <crt@teleco.ch> | 2026-03-08 15:57:23 +0100 |
| commit | c702ff9c873b1cdcb8796e1dd7da090f1d3e027c (patch) | |
| tree | 4d569ceb470eacb796cab4f5a09a0461372b8192 /src | |
| parent | 4cc3e2bf861ba04e3924e337b9ac5d3e8d21eb02 (diff) | |
test
Diffstat (limited to 'src')
| -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() }; |
