diff options
Diffstat (limited to '')
-rw-r--r-- | winit/src/application.rs | 2 | ||||
-rw-r--r-- | winit/src/icon.rs | 8 | ||||
-rw-r--r-- | winit/src/settings.rs | 23 |
3 files changed, 30 insertions, 3 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 3123a318..58556da4 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -155,7 +155,7 @@ where ) .with_visible(false); - log::info!("Window builder: {:#?}", builder); + log::debug!("Window builder: {:#?}", builder); let window = builder .build(&event_loop) diff --git a/winit/src/icon.rs b/winit/src/icon.rs index 73b4e037..4113d9d0 100644 --- a/winit/src/icon.rs +++ b/winit/src/icon.rs @@ -6,9 +6,15 @@ use std::io; use std::path::Path; /// The icon of a window. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Icon(winit::window::Icon); +impl fmt::Debug for Icon { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("Icon").field(&format_args!("_")).finish() + } +} + impl Icon { /// Creates an icon from 32bpp RGBA data. pub fn from_rgba( diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 2f73aff6..b26de542 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -24,9 +24,12 @@ pub use platform::PlatformSpecific; use crate::conversion; use crate::Icon; use crate::Position; + use winit::monitor::MonitorHandle; use winit::window::WindowBuilder; +use std::fmt; + /// The settings of an application. #[derive(Debug, Clone, Default)] pub struct Settings<Flags> { @@ -64,7 +67,7 @@ pub struct Settings<Flags> { } /// The window settings of an application. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Window { /// The size of the window. pub size: (u32, u32), @@ -100,6 +103,24 @@ pub struct Window { pub platform_specific: platform::PlatformSpecific, } +impl fmt::Debug for Window { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Window") + .field("size", &self.size) + .field("position", &self.position) + .field("min_size", &self.min_size) + .field("max_size", &self.max_size) + .field("visible", &self.visible) + .field("resizable", &self.resizable) + .field("decorations", &self.decorations) + .field("transparent", &self.transparent) + .field("always_on_top", &self.always_on_top) + .field("icon", &self.icon.is_some()) + .field("platform_specific", &self.platform_specific) + .finish() + } +} + impl Window { /// Converts the window settings into a `WindowBuilder` from `winit`. pub fn into_builder( |