Skip to content

Commit 01e49f2

Browse files
committed
Show component docs when hovering
1 parent 0017bfa commit 01e49f2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

crates/re_data_ui/src/component_name.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ impl DataUi for ComponentName {
2020
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
2121
ui.label(format!("Full name: {}", self.full_name()));
2222

23+
// Only show the first line of the docs:
24+
if let Some(markdown) = re_types_registry::components::registry()
25+
.get(self)
26+
.and_then(|info| info.docstring_md.lines().next())
27+
{
28+
ui.markdown_ui(egui::Id::new(self), markdown);
29+
}
30+
2331
if let Some(url) = self.doc_url() {
2432
ui.re_hyperlink("Full documentation", url);
2533
}

0 commit comments

Comments
 (0)