Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide tooltip for data density graph of collapsed time panel #8143

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading