diff --git a/egui/src/ui.rs b/egui/src/ui.rs index 23961fee..16c6b622 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -643,6 +643,13 @@ impl Ui { self.add(label.into().monospace()) } + /// Show text as monospace with a gray background. + /// + /// Shortcut for `add(Label::new(text).code())` + pub fn code(&mut self, label: impl Into