Fix window::Icon verbose Debug implementation
This commit is contained in:
parent
04639a4194
commit
49a300ab38
1 changed files with 10 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ pub fn from_rgba(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An window icon normally used for the titlebar or taskbar.
|
/// An window icon normally used for the titlebar or taskbar.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Icon {
|
pub struct Icon {
|
||||||
rgba: Vec<u8>,
|
rgba: Vec<u8>,
|
||||||
size: Size<u32>,
|
size: Size<u32>,
|
||||||
|
|
@ -48,6 +48,15 @@ impl Icon {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for Icon {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("Icon")
|
||||||
|
.field("rgba", &format!("{} pixels", self.rgba.len() / 4))
|
||||||
|
.field("size", &self.size)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
/// An error produced when using [`from_rgba`] with invalid arguments.
|
/// An error produced when using [`from_rgba`] with invalid arguments.
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue