Skip to content

Commit

Permalink
Window icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Bash authored and Bash committed May 26, 2024
1 parent cc617ff commit 5433d27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Binary file added src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use tf_demo_parser::{

pub mod gui;

const WINDOW_ICON: &[u8] = include_bytes!("icon.png");

const DEFAULT_THUMBNAIL: &[u8] = include_bytes!("default.png");

const TEMPLATE_DMX: &str = include_str!("template_dmx.txt");
Expand Down Expand Up @@ -81,9 +83,12 @@ impl Application for App {
status: String::new(),
};

let icon = iced::window::icon::from_file_data(WINDOW_ICON, Some(ImageFormat::Png))
.expect("Invalid window icon.");

app.load_thumbnail(None)
.expect("Coudln't load default thumbnail");
(app, iced::Command::none())
(app, iced::window::change_icon(iced::window::Id::MAIN, icon))
}

fn title(&self) -> String {
Expand Down

0 comments on commit 5433d27

Please sign in to comment.