Skip to content

Commit

Permalink
less verbose on_hover_text
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed May 27, 2024
1 parent 3ef94ca commit 05223ea
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/re_space_view/src/view_property_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn view_property_ui<A: Archetype>(
let display_name =
field_info.map_or_else(|| component_name.short_name(), |info| info.display_name);

let list_item_response = list_item::ListItem::new(re_ui)
let mut list_item_response = list_item::ListItem::new(re_ui)
.interactive(false)
.show_flat(
ui,
Expand All @@ -67,12 +67,9 @@ pub fn view_property_ui<A: Archetype>(
}),
);

let list_item_response =
if let Some(tooltip) = field_info.map(|info| info.documentation) {
list_item_response.on_hover_text(tooltip)
} else {
list_item_response
};
if let Some(tooltip) = field_info.map(|info| info.documentation) {
list_item_response = list_item_response.on_hover_text(tooltip)
}

list_item_response.context_menu(|ui| {
if ui.button("Reset to default blueprint.")
Expand Down

0 comments on commit 05223ea

Please sign in to comment.