Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,20 @@ impl WindowsResource {
self
}

/// Add an icon with nameID `1`.
/// Add an icon with nameID `32512`.
///
/// This icon need to be in `ico` format. The filename can be absolute
/// This icon needs to be in `ico` format. The filename can be absolute
/// or relative to the projects root.
///
/// Equivalent to `set_icon_with_id(path, "1")`.
/// Equivalent to `set_icon_with_id(path, "32512")`.
///
/// Windows uses `32512` as the default icon ID. See
/// [here](https://learn.microsoft.com/en-us/windows/win32/menurc/about-icons#icon-types)
/// for Windows docs demonstrating this.
pub fn set_icon<'a>(&mut self, path: &'a str) -> &mut Self {
self.set_icon_with_id(path, "1")
const DEFAULT_APPLICATION_ICON_ID: &str = "32512";

self.set_icon_with_id(path, DEFAULT_APPLICATION_ICON_ID)
}

/// Add an icon with the specified name ID.
Expand Down