Skip to content

add Image::as_app_icon to allow ergonomically setting the window icon #928

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cyrgani
Copy link
Contributor

@cyrgani cyrgani commented Mar 26, 2025

This PR adds the function Image::as_app_icon, which can be used to construct a miniquad::conf::Icon for use in a Conf. Previously, there was no practical way to do this, except to manually use include_bytes! and have three differently scaled versions. (best example of this: https://github.com/not-fl3/miniquad/blob/master/src/default_icon.rs)
The PR also includes a small example that shows it is working as intended.

Note that this is built on top of #927.

@cyrgani cyrgani changed the title add Image::as_app_icon to allow ergnomically setting the window icon add Image::as_app_icon to allow ergonomically setting the window icon Mar 26, 2025
@cyrgani
Copy link
Contributor Author

cyrgani commented Apr 11, 2025

An alternative would be to merge not-fl3/miniquad#540 first and then either close this PR or make Image::as_app_icon a trivial wrapper around Icon::from_bytes.

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.

1 participant