From 04f71ee34fca8037754314b655910022090bd57c Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 31 Jul 2023 06:38:13 +0700 Subject: [PATCH] impl `fmt::Debug` for `WindowLevel`. (#123) --- src/window.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/window.rs b/src/window.rs index a89f0237..eacaa32d 100644 --- a/src/window.rs +++ b/src/window.rs @@ -15,6 +15,7 @@ //! Platform independent window types. use std::any::Any; +use std::fmt; use std::time::Duration; use crate::application::Application; @@ -162,6 +163,17 @@ pub enum WindowLevel { Modal(WindowHandle), } +impl fmt::Debug for WindowLevel { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + WindowLevel::AppWindow => write!(f, "AppWindow"), + WindowLevel::Tooltip(_) => write!(f, "Tooltip"), + WindowLevel::DropDown(_) => write!(f, "DropDown"), + WindowLevel::Modal(_) => write!(f, "Modal"), + } + } +} + /// Contains the different states a Window can be in. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WindowState {