Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window icon settings added #202

Merged
merged 2 commits into from
Jan 7, 2023
Merged

Conversation

joffreybesos
Copy link
Contributor

I added window_icon and taskbar_icon to the window builder.
This will accept an optional path to a file to use.
It should work with jpeg, png and ico files.

I have only tested this on windows.

I also updated the window_config example to include these two settings, and a rust.ico asset file.
There's an ugly load_icon function added in notan_winit window.rs but wasn't sure of where else to place it.

e.g.

    let window_config = WindowConfig::new()
        .title("Window Config Demo")
        .size(1026, 600) // window's size
        .vsync(true) // enable vsync
        .resizable(true) // window can be resized
        .min_size(600, 400) // Set a minimum window size
        .window_icon(Some(PathBuf::from("./examples/assets/rust.ico")))
        .taskbar_icon(Some(PathBuf::from("./examples/assets/rust.ico")));

@Nazariglez
Copy link
Owner

This looks great! I just fixed the compilation for other platforms. Once the CI is done, I'll merge it.

Thank you so much!

@Nazariglez Nazariglez merged commit 534d8fd into Nazariglez:develop Jan 7, 2023
@Nazariglez Nazariglez added this to the 0.9.0 milestone Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants