From d34d59e4ea8a0ef0ebb902cd205d37e10a489164 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Tue, 16 Jan 2024 21:45:45 +0100 Subject: [PATCH] Cleanup menu / config options --- crates/re_time_panel/src/lib.rs | 9 +++------ crates/re_viewer/src/app.rs | 6 +++--- crates/re_viewer/src/app_state.rs | 4 ++-- crates/re_viewer/src/ui/rerun_menu.rs | 10 +++++----- crates/re_viewer/src/ui/selection_panel.rs | 2 +- crates/re_viewer_context/src/app_options.rs | 6 +++--- crates/re_viewer_context/src/command_sender.rs | 2 +- crates/re_viewer_context/src/viewer_context.rs | 2 +- 8 files changed, 19 insertions(+), 22 deletions(-) diff --git a/crates/re_time_panel/src/lib.rs b/crates/re_time_panel/src/lib.rs index 36e8236f60eb5..dd06e97f2117a 100644 --- a/crates/re_time_panel/src/lib.rs +++ b/crates/re_time_panel/src/lib.rs @@ -778,15 +778,12 @@ impl TimePanel { if cfg!(debug_assertions) && ui - .selectable_label( - ctx.app_options.show_blueprint_in_timeline, - "View Blueprint", - ) + .selectable_label(ctx.app_options.show_blueprint_timeline, "View Blueprint") .clicked() { ctx.command_sender - .send_system(SystemCommand::ShowBlueprintInTimeline( - !ctx.app_options.show_blueprint_in_timeline, + .send_system(SystemCommand::ShowBlueprintTimeline( + !ctx.app_options.show_blueprint_timeline, )); } }); diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index e294dccda9cfe..99845e4d3c34d 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -374,7 +374,7 @@ impl App { store_hub.clear_blueprint(); } SystemCommand::UpdateBlueprint(blueprint_id, updates) => { - if !self.state.app_options.show_blueprint_in_timeline { + if !self.state.app_options.show_blueprint_timeline { let blueprint_db = store_hub.entity_db_mut(&blueprint_id); for row in updates { match blueprint_db.add_data_row(row) { @@ -386,8 +386,8 @@ impl App { } } } - SystemCommand::ShowBlueprintInTimeline(show) => { - self.app_options_mut().show_blueprint_in_timeline = show; + SystemCommand::ShowBlueprintTimeline(show) => { + self.app_options_mut().show_blueprint_timeline = show; } SystemCommand::EnableExperimentalDataframeSpaceView(enabled) => { let result = if enabled { diff --git a/crates/re_viewer/src/app_state.rs b/crates/re_viewer/src/app_state.rs index ee1b4a49289de..73a6995f45c66 100644 --- a/crates/re_viewer/src/app_state.rs +++ b/crates/re_viewer/src/app_state.rs @@ -263,7 +263,7 @@ impl AppState { focused_item, }; - if app_options.show_blueprint_in_timeline { + if app_options.show_blueprint_timeline { blueprint_panel.show_panel( &ctx, ctx.store_context.blueprint, @@ -395,7 +395,7 @@ impl AppState { } pub fn blueprint_query(&self) -> LatestAtQuery { - if self.app_options.show_blueprint_in_timeline { + if self.app_options.show_blueprint_timeline { self.blueprint_cfg.time_ctrl.read().current_query().clone() } else { LatestAtQuery::latest(blueprint_timeline()) diff --git a/crates/re_viewer/src/ui/rerun_menu.rs b/crates/re_viewer/src/ui/rerun_menu.rs index 5e5a1fae87250..61cd275364f5d 100644 --- a/crates/re_viewer/src/ui/rerun_menu.rs +++ b/crates/re_viewer/src/ui/rerun_menu.rs @@ -316,16 +316,16 @@ fn experimental_feature_ui( .on_hover_text("The legacy container blueprint storage is deprecated, but may be helpful if unexpected regressions are found in the new container blueprints."); re_ui.checkbox(ui, - &mut app_options.show_blueprint_in_timeline, - "Show Blueprint in the Time Panel", + &mut app_options.show_blueprint_timeline, + "Show a timeline of the Blueprint data.", ) .on_hover_text("Show the Blueprint data in the Time Panel tree view. This is useful for debugging the internal blueprint state."); re_ui.checkbox(ui, &mut app_options.disable_blueprint_gc, - "Disable the blueprint GC", + "Disable the blueprint garbage collector.", ) - .on_hover_text("Don't GC the blueprint data. This is useful for debugging the internal blueprint state."); + .on_hover_text("Don't garbage collect the blueprint data. This is useful for debugging the internal blueprint state."); } #[cfg(debug_assertions)] @@ -397,7 +397,7 @@ fn debug_menu_options_ui( ).on_hover_text("Show a debug overlay that renders the picking layer information using the `debug_overlay.wgsl` shader."); re_ui.checkbox(ui, - &mut app_options.show_blueprint_in_timeline, + &mut app_options.show_blueprint_timeline, "Show Blueprint in the Time Panel", ).on_hover_text("Show the Blueprint data in the Time Panel tree view. This is useful for debugging the internal blueprint state."); diff --git a/crates/re_viewer/src/ui/selection_panel.rs b/crates/re_viewer/src/ui/selection_panel.rs index 3d05aecd07c14..96a1a5037ec21 100644 --- a/crates/re_viewer/src/ui/selection_panel.rs +++ b/crates/re_viewer/src/ui/selection_panel.rs @@ -5,7 +5,7 @@ use re_data_ui::{image_meaning_for_entity, item_ui, DataUi}; use re_entity_db::{ ColorMapper, Colormap, EditableAutoValue, EntityPath, EntityProperties, VisibleHistory, }; -use re_log_types::{DataRow, EntityPathFilter, RowId, TimePoint}; +use re_log_types::{DataRow, EntityPathFilter, RowId}; use re_space_view_time_series::TimeSeriesSpaceView; use re_types::{ components::{PinholeProjection, Transform3D}, diff --git a/crates/re_viewer_context/src/app_options.rs b/crates/re_viewer_context/src/app_options.rs index 212be43b90fc9..c48a067444d7e 100644 --- a/crates/re_viewer_context/src/app_options.rs +++ b/crates/re_viewer_context/src/app_options.rs @@ -39,9 +39,9 @@ pub struct AppOptions { pub show_picking_debug_overlay: bool, /// Includes the blueprint in the timeline view. - pub show_blueprint_in_timeline: bool, + pub show_blueprint_timeline: bool, - /// Includes the blueprint in the timeline view. + /// Disable garbage collection of the blueprint. pub disable_blueprint_gc: bool, /// What time zone to display timestamps in. @@ -72,7 +72,7 @@ impl Default for AppOptions { show_picking_debug_overlay: false, - show_blueprint_in_timeline: false, + show_blueprint_timeline: false, disable_blueprint_gc: false, diff --git a/crates/re_viewer_context/src/command_sender.rs b/crates/re_viewer_context/src/command_sender.rs index fea7d511039b8..6d4b695091da9 100644 --- a/crates/re_viewer_context/src/command_sender.rs +++ b/crates/re_viewer_context/src/command_sender.rs @@ -34,7 +34,7 @@ pub enum SystemCommand { UpdateBlueprint(StoreId, Vec), /// Show blueprint in timeline - ShowBlueprintInTimeline(bool), + ShowBlueprintTimeline(bool), /// Enable or disable the experimental dataframe space views. EnableExperimentalDataframeSpaceView(bool), diff --git a/crates/re_viewer_context/src/viewer_context.rs b/crates/re_viewer_context/src/viewer_context.rs index 9bfeff79c41de..8be40561a43c8 100644 --- a/crates/re_viewer_context/src/viewer_context.rs +++ b/crates/re_viewer_context/src/viewer_context.rs @@ -99,7 +99,7 @@ impl<'a> ViewerContext<'a> { &self, entity_path: &EntityPath, ) -> re_data_store::LatestAtQuery { - if self.app_options.show_blueprint_in_timeline + if self.app_options.show_blueprint_timeline && self.store_context.blueprint.is_logged_entity(entity_path) { self.blueprint_cfg.time_ctrl.read().current_query()