From 9bdf2fdf6817b30d99213882fb48de01eddebd72 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Tue, 24 Sep 2024 11:18:16 +0200 Subject: [PATCH 1/2] Text fields in the selection panel now span the available width --- .../re_selection_panel/src/selection_panel.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/viewer/re_selection_panel/src/selection_panel.rs b/crates/viewer/re_selection_panel/src/selection_panel.rs index 101a7feebb4a..648fc9d8cec5 100644 --- a/crates/viewer/re_selection_panel/src/selection_panel.rs +++ b/crates/viewer/re_selection_panel/src/selection_panel.rs @@ -1,3 +1,4 @@ +use egui::NumExt as _; use egui_tiles::ContainerKind; use re_context_menu::{context_menu_ui_for_item, SelectionUpdateBehavior}; @@ -542,8 +543,11 @@ fn entity_path_filter_ui( .clone() }); - let response = - ui.add(egui::TextEdit::multiline(&mut filter_string).layouter(&mut text_layouter)); + let response = ui.add( + egui::TextEdit::multiline(&mut filter_string) + .desired_width(ui.spacing().text_edit_width.at_least(ui.available_width())) + .layouter(&mut text_layouter), + ); if response.has_focus() { ui.data_mut(|data| data.insert_temp::(filter_text_id, filter_string.clone())); @@ -928,12 +932,22 @@ fn view_top_level_properties( view: &re_viewport_blueprint::SpaceViewBlueprint, ) { ui.list_item_flat_noninteractive(PropertyContent::new("Name").value_fn(|ui, _| { + ui.spacing_mut().text_edit_width = ui + .spacing_mut() + .text_edit_width + .at_least(ui.available_width()); + let mut name = view.display_name.clone().unwrap_or_default(); ui.add(egui::TextEdit::singleline(&mut name).hint_text("(default)")); view.set_display_name(ctx, if name.is_empty() { None } else { Some(name) }); })); ui.list_item_flat_noninteractive(PropertyContent::new("Space origin").value_fn(|ui, _| { + ui.spacing_mut().text_edit_width = ui + .spacing_mut() + .text_edit_width + .at_least(ui.available_width()); + super::space_view_space_origin_ui::space_view_space_origin_widget_ui(ui, ctx, view); })) .on_hover_text( From ca09ff683d37eeeafec0fe23a83487be82558450 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Tue, 24 Sep 2024 11:21:44 +0200 Subject: [PATCH 2/2] Also for container name --- crates/viewer/re_selection_panel/src/selection_panel.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/viewer/re_selection_panel/src/selection_panel.rs b/crates/viewer/re_selection_panel/src/selection_panel.rs index 648fc9d8cec5..95bf509d17c3 100644 --- a/crates/viewer/re_selection_panel/src/selection_panel.rs +++ b/crates/viewer/re_selection_panel/src/selection_panel.rs @@ -974,6 +974,11 @@ fn container_top_level_properties( }; ui.list_item_flat_noninteractive(PropertyContent::new("Name").value_fn(|ui, _| { + ui.spacing_mut().text_edit_width = ui + .spacing_mut() + .text_edit_width + .at_least(ui.available_width()); + let mut name = container.display_name.clone().unwrap_or_default(); ui.add(egui::TextEdit::singleline(&mut name)); container.set_display_name(ctx, if name.is_empty() { None } else { Some(name) });