add action set icon while running (#1590)
* set windows icon live action * change get icon to insto raw * remove mobile docs * format * fix format * add file methods to Icon * Rename action to `ChangeIcon` and tidy up `Icon` modules * Fix documentation of `icon::Error` * Remove unnecessary `\` in `icon` documentation * Remove `etc.` from `Icon` documentation --------- Co-authored-by: Héctor Ramón Jiménez <hector0193@gmail.com>
This commit is contained in:
parent
e7549877ef
commit
5a056ce051
9 changed files with 177 additions and 163 deletions
|
|
@ -510,6 +510,15 @@ pub fn user_attention(
|
|||
}
|
||||
}
|
||||
|
||||
/// Converts some [`Icon`] into it's `winit` counterpart.
|
||||
///
|
||||
/// Returns `None` if there is an error during the conversion.
|
||||
pub fn icon(icon: window::Icon) -> Option<winit::window::Icon> {
|
||||
let (pixels, size) = icon.into_raw();
|
||||
|
||||
winit::window::Icon::from_rgba(pixels, size.width, size.height).ok()
|
||||
}
|
||||
|
||||
// As defined in: http://www.unicode.org/faq/private_use.html
|
||||
pub(crate) fn is_private_use_character(c: char) -> bool {
|
||||
matches!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue