dioxus_use_window/hooks/use_window/
display.rs

1use super::*;
2
3impl Default for UseWindow {
4    fn default() -> Self {
5        Self { data: Rc::new(RefCell::new(Default::default())), listen_window_resize: None, listen_fullscreen: None }
6    }
7}
8
9impl Debug for UseWindow {
10    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
11        let size = self.size();
12        f.debug_struct("WindowSize")
13            .field("width", &size.0)
14            .field("height", &size.1)
15            .field("aspect_radio", &self.aspect_radio())
16            .field("listen_window_resize", &self.listen_window_resize.is_some())
17            .field("listen_fullscreen", &self.listen_fullscreen.is_some())
18            .finish()
19    }
20}
21
22impl Display for UseWindow {
23    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
24        Debug::fmt(&self.size(), f)
25    }
26}