diff --git a/crates/egui/src/data/output.rs b/crates/egui/src/data/output.rs index d1db5fc2..97794f4d 100644 --- a/crates/egui/src/data/output.rs +++ b/crates/egui/src/data/output.rs @@ -504,7 +504,10 @@ impl std::fmt::Debug for WidgetInfo { let mut s = f.debug_struct("WidgetInfo"); s.field("typ", typ); - s.field("enabled", enabled); + + if !enabled { + s.field("enabled", enabled); + } if let Some(label) = label { s.field("label", label); diff --git a/crates/egui/src/id.rs b/crates/egui/src/id.rs index 1cd96fae..0465c32d 100644 --- a/crates/egui/src/id.rs +++ b/crates/egui/src/id.rs @@ -85,7 +85,7 @@ impl Id { impl std::fmt::Debug for Id { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:016X}", self.0) + write!(f, "{:04X}", self.value() as u16) } } diff --git a/crates/egui/src/sense.rs b/crates/egui/src/sense.rs index ca216896..1b6394b2 100644 --- a/crates/egui/src/sense.rs +++ b/crates/egui/src/sense.rs @@ -1,5 +1,5 @@ /// What sort of interaction is a widget sensitive to? -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] // #[cfg_attr(feature = "serde", derive(serde::Serialize))] pub struct Sense { /// Buttons, sliders, windows, … @@ -15,6 +15,28 @@ pub struct Sense { pub focusable: bool, } +impl std::fmt::Debug for Sense { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let Self { + click, + drag, + focusable, + } = self; + + write!(f, "Sense {{")?; + if *click { + write!(f, " click")?; + } + if *drag { + write!(f, " drag")?; + } + if *focusable { + write!(f, " focusable")?; + } + write!(f, " }}") + } +} + impl Sense { /// Senses no clicks or drags. Only senses mouse hover. #[doc(alias = "none")]