Commit 78d974f 1 parent 8d2e79c commit 78d974f Copy full SHA for 78d974f
File tree 2 files changed +16
-13
lines changed
re_edit_ui/src/datatype_editors
re_viewer_context/src/gpu_bridge
2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ fn edit_view_enum_impl<EnumT: re_types_core::reflection::Enum>(
48
48
49
49
response_with_changes_of_inner ( combobox_response)
50
50
} else {
51
- ui. label ( current_value. to_string ( ) )
51
+ ui. add ( egui :: Label :: new ( current_value. to_string ( ) ) . truncate ( ) )
52
52
}
53
53
}
54
54
Original file line number Diff line number Diff line change 1
1
use re_types:: reflection:: Enum as _;
2
- use re_ui:: { list_item, UiExt } ;
2
+ use re_ui:: list_item;
3
3
4
4
use crate :: {
5
5
gpu_bridge:: { get_or_create_texture, render_image} ,
@@ -136,18 +136,21 @@ pub fn colormap_edit_or_view_ui(
136
136
inner_response. response
137
137
} else {
138
138
let map: re_types:: components:: Colormap = * * map;
139
- if let Some ( render_ctx) = ctx. render_ctx {
140
- ui. list_item_flat_noninteractive (
141
- list_item:: PropertyContent :: new ( map. to_string ( ) )
142
- . min_desired_width ( MIN_WIDTH )
143
- . value_fn ( |ui, _| {
144
- if let Err ( err) = colormap_preview_ui ( render_ctx, ui, map) {
145
- re_log:: error_once!( "Failed to paint colormap preview: {err}" ) ;
146
- }
147
- } ) ,
148
- )
139
+ let colormap_response = if let Some ( render_ctx) = ctx. render_ctx {
140
+ let result = colormap_preview_ui ( render_ctx, ui, map) ;
141
+ if let Err ( err) = & result {
142
+ re_log:: error_once!( "Failed to paint colormap preview: {err}" ) ;
143
+ }
144
+ result. ok ( )
149
145
} else {
150
- ui. list_item_flat_noninteractive ( list_item:: LabelContent :: new ( map. to_string ( ) ) )
146
+ None
147
+ } ;
148
+
149
+ let label_response = ui. add ( egui:: Label :: new ( map. to_string ( ) ) . truncate ( ) ) ;
150
+
151
+ match colormap_response {
152
+ Some ( colormap_response) => colormap_response | label_response,
153
+ None => label_response,
151
154
}
152
155
}
153
156
}
You can’t perform that action at this time.
0 commit comments