aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/app.rs b/src/app.rs
index 4f3aefb..55c75df 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -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()
};