Skip to content

Commit

Permalink
Hide tooltip for data density graph of collapsed time panel (#8143)
Browse files Browse the repository at this point in the history
### What
* Follow-up on #8137

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
  • Loading branch information
emilk authored and Wumpf committed Nov 14, 2024
1 parent 48d3929 commit 709d1a9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/viewer/re_data_ui/src/instance_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl DataUi for InstancePath {
ui_layout.label(
ui,
format!(
"No components logged on timeline {:?}",
"{self} has no components on timeline {:?}",
query.timeline().name()
),
);
Expand Down
31 changes: 17 additions & 14 deletions crates/viewer/re_time_panel/src/data_density_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ pub fn data_density_graph_ui(
time_ranges_ui: &TimeRangesUi,
row_rect: Rect,
item: &TimePanelItem,
tooltips_enabled: bool,
) {
re_tracing::profile_function!();

Expand All @@ -410,20 +411,22 @@ pub fn data_density_graph_ui(
0f32..=0f32,
);

if let Some(hovered_time) = data.hovered_time {
ctx.selection_state().set_hovered(item.to_item());

if ui.ctx().dragged_id().is_none() {
// TODO(jprochazk): check chunk.num_rows() and chunk.timeline.is_sorted()
// if too many rows and unsorted, show some generic error tooltip (=too much data)
egui::show_tooltip_at_pointer(
ui.ctx(),
ui.layer_id(),
egui::Id::new("data_tooltip"),
|ui| {
show_row_ids_tooltip(ctx, ui, time_ctrl, db, item, hovered_time);
},
);
if tooltips_enabled {
if let Some(hovered_time) = data.hovered_time {
ctx.selection_state().set_hovered(item.to_item());

if ui.ctx().dragged_id().is_none() {
// TODO(jprochazk): check chunk.num_rows() and chunk.timeline.is_sorted()
// if too many rows and unsorted, show some generic error tooltip (=too much data)
egui::show_tooltip_at_pointer(
ui.ctx(),
ui.layer_id(),
egui::Id::new("data_tooltip"),
|ui| {
show_row_ids_tooltip(ctx, ui, time_ctrl, db, item, hovered_time);
},
);
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/viewer/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ impl TimePanel {
&self.time_ranges_ui,
row_rect,
&item,
true,
);
}
}
Expand Down Expand Up @@ -909,6 +910,7 @@ impl TimePanel {
&self.time_ranges_ui,
row_rect,
&item,
true,
);
}
}
Expand Down Expand Up @@ -1051,6 +1053,7 @@ fn collapsed_time_marker_and_time(
&time_ranges_ui,
time_range_rect.shrink2(egui::vec2(0.0, 10.0)),
&TimePanelItem::entity_path(EntityPath::root()),
false,
);

time_marker_ui(
Expand Down

0 comments on commit 709d1a9

Please sign in to comment.