From c0554349b18945bca14bb4b9bb7e7c8ed5e8475a Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 14 Nov 2024 12:15:59 +0100 Subject: [PATCH 1/4] Bug fix: fix clicking the time area for collapsed time panel --- crates/viewer/re_time_panel/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/viewer/re_time_panel/src/lib.rs b/crates/viewer/re_time_panel/src/lib.rs index 48beffb89615..9bec929b28a1 100644 --- a/crates/viewer/re_time_panel/src/lib.rs +++ b/crates/viewer/re_time_panel/src/lib.rs @@ -1005,6 +1005,8 @@ fn collapsed_time_marker_and_time( time_range_rect.max.x -= space_needed_for_current_time; if time_range_rect.width() > 50.0 { + ui.allocate_rect(time_range_rect, egui::Sense::hover()); + let time_ranges_ui = initialize_time_ranges_ui(entity_db, time_ctrl, time_range_rect.x_range(), None); time_ranges_ui.snap_time_control(time_ctrl); @@ -1033,8 +1035,6 @@ fn collapsed_time_marker_and_time( &painter, &time_range_rect, ); - - ui.allocate_rect(time_range_rect, egui::Sense::hover()); } } From 6d1b87c32faf18251a761b17a5e0a865d3c0fb8a Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 14 Nov 2024 12:16:40 +0100 Subject: [PATCH 2/4] Show root density graph in the collapsed time panel --- crates/viewer/re_time_panel/src/lib.rs | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/crates/viewer/re_time_panel/src/lib.rs b/crates/viewer/re_time_panel/src/lib.rs index 9bec929b28a1..cfaad675378a 100644 --- a/crates/viewer/re_time_panel/src/lib.rs +++ b/crates/viewer/re_time_panel/src/lib.rs @@ -298,7 +298,13 @@ impl TimePanel { entity_db.times_per_timeline(), ui, ); - collapsed_time_marker_and_time(ui, ctx, entity_db, time_ctrl); + collapsed_time_marker_and_time( + ui, + ctx, + &mut self.data_density_graph_painter, + entity_db, + time_ctrl, + ); }); }); } else { @@ -318,7 +324,13 @@ impl TimePanel { self.time_control_ui.fps_ui(time_ctrl, ui); } - collapsed_time_marker_and_time(ui, ctx, entity_db, time_ctrl); + collapsed_time_marker_and_time( + ui, + ctx, + &mut self.data_density_graph_painter, + entity_db, + time_ctrl, + ); } } @@ -983,6 +995,7 @@ fn highlight_timeline_row( fn collapsed_time_marker_and_time( ui: &mut egui::Ui, ctx: &ViewerContext<'_>, + data_density_graph_painter: &mut data_density_graph::DataDensityGraphPainter, entity_db: &re_entity_db::EntityDb, time_ctrl: &mut TimeControl, ) { @@ -1027,6 +1040,19 @@ fn collapsed_time_marker_and_time( time_range_rect.center().y, ui.visuals().widgets.noninteractive.fg_stroke, ); + + data_density_graph::data_density_graph_ui( + data_density_graph_painter, + ctx, + time_ctrl, + entity_db, + ui.painter(), + ui, + &time_ranges_ui, + time_range_rect.shrink2(egui::vec2(0.0, 8.0)), + &TimePanelItem::entity_path(EntityPath::root()), + ); + time_marker_ui( &time_ranges_ui, time_ctrl, From 299229afaf2e63d0f50f92db3dd97d2ee739cdc3 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 14 Nov 2024 13:21:30 +0100 Subject: [PATCH 3/4] Make it slightly thinner --- crates/viewer/re_time_panel/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/viewer/re_time_panel/src/lib.rs b/crates/viewer/re_time_panel/src/lib.rs index cfaad675378a..1eb968d7e31d 100644 --- a/crates/viewer/re_time_panel/src/lib.rs +++ b/crates/viewer/re_time_panel/src/lib.rs @@ -1049,7 +1049,7 @@ fn collapsed_time_marker_and_time( ui.painter(), ui, &time_ranges_ui, - time_range_rect.shrink2(egui::vec2(0.0, 8.0)), + time_range_rect.shrink2(egui::vec2(0.0, 10.0)), &TimePanelItem::entity_path(EntityPath::root()), ); From 886c590bc2142cb4e17a64345196b85f537f22f6 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 14 Nov 2024 13:26:01 +0100 Subject: [PATCH 4/4] Fix density graph normalization --- crates/viewer/re_time_panel/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/viewer/re_time_panel/src/lib.rs b/crates/viewer/re_time_panel/src/lib.rs index 1eb968d7e31d..4622628c88c8 100644 --- a/crates/viewer/re_time_panel/src/lib.rs +++ b/crates/viewer/re_time_panel/src/lib.rs @@ -158,6 +158,8 @@ impl TimePanel { return; } + self.data_density_graph_painter.begin_frame(ui.ctx()); + // Naturally, many parts of the time panel need the time control. // Copy it once, read/edit, and then write back at the end if there was a change. let time_ctrl_before = rec_cfg.time_ctrl.read().clone(); @@ -344,8 +346,6 @@ impl TimePanel { ) { re_tracing::profile_function!(); - self.data_density_graph_painter.begin_frame(ui.ctx()); - // |timeline | // ------------------------------------ // tree |streams |