Skip to content

Commit

Permalink
Provide starter code to set native icon (#122)
Browse files Browse the repository at this point in the history
* Provide code to user to show how to set icon

* add a comment

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
  • Loading branch information
c-git and emilk authored Jan 10, 2024
1 parent a2dcdb9 commit 50ce36a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ fn main() -> eframe::Result<()> {
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_inner_size([400.0, 300.0])
.with_min_inner_size([300.0, 220.0]),
.with_min_inner_size([300.0, 220.0])
.with_icon(
// NOE: Adding an icon is optional
eframe::icon_data::from_png_bytes(&include_bytes!("../assets/icon-256.png")[..])
.unwrap(),
),
..Default::default()
};
eframe::run_native(
Expand Down

0 comments on commit 50ce36a

Please sign in to comment.