Skip to content

Commit

Permalink
Introduce windows app icons
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Jan 1, 2024
1 parent 6755d0d commit c0240ff
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions neothesia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ iced_widget = { git = "https://github.com/iced-rs/iced.git", rev="fc285d3e461626

[[bin]]
name = "neothesia"

[build-dependencies]
embed-resource = "2.4.0"
4 changes: 4 additions & 0 deletions neothesia/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
#[cfg(target_os = "windows")]
embed_resource::compile("manifest.rc", embed_resource::NONE);
}
Binary file added neothesia/icon.ico
Binary file not shown.
Binary file added neothesia/icon.rgba
Binary file not shown.
1 change: 1 addition & 0 deletions neothesia/manifest.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neothesia_icon ICON "icon.ico"
4 changes: 4 additions & 0 deletions neothesia/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ fn init(builder: winit::window::WindowBuilder) -> (EventLoop<NeothesiaEvent>, Ta

let window = builder.build(&event_loop).unwrap();

window.set_window_icon(Some(
winit::window::Icon::from_rgba(include_bytes!("../icon.rgba").to_vec(), 256, 256).unwrap(),
));

let window_state = WindowState::new(&window);
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu_jumpstart::default_backends(),
Expand Down

0 comments on commit c0240ff

Please sign in to comment.