File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1074,26 +1074,28 @@ fn render_number(
10741074 }
10751075 if !field. units . is_empty ( ) {
10761076 let mut current_unit = field. unit . clone ( ) . unwrap_or_default ( ) ;
1077- egui:: ComboBox :: from_id_salt ( format ! ( "extra-unit-{}" , idx) )
1078- . width ( 90.0 )
1079- . selected_text ( if current_unit. is_empty ( ) {
1080- "Unit"
1081- } else {
1082- & current_unit
1083- } )
1084- . show_ui ( ui, |ui| {
1085- for unit in & field. units {
1086- if ui
1087- . selectable_value ( & mut current_unit, unit. clone ( ) , unit)
1088- . clicked ( )
1089- {
1090- msgs. push ( ExtraFieldsMsg :: SelectUnit {
1091- index : idx,
1092- unit : unit. clone ( ) ,
1093- } ) ;
1077+ ui. add_enabled_ui ( !disabled, |ui| {
1078+ egui:: ComboBox :: from_id_salt ( format ! ( "extra-unit-{}" , idx) )
1079+ . width ( 90.0 )
1080+ . selected_text ( if current_unit. is_empty ( ) {
1081+ "Unit"
1082+ } else {
1083+ & current_unit
1084+ } )
1085+ . show_ui ( ui, |ui| {
1086+ for unit in & field. units {
1087+ if ui
1088+ . selectable_value ( & mut current_unit, unit. clone ( ) , unit)
1089+ . clicked ( )
1090+ {
1091+ msgs. push ( ExtraFieldsMsg :: SelectUnit {
1092+ index : idx,
1093+ unit : unit. clone ( ) ,
1094+ } ) ;
1095+ }
10941096 }
1095- }
1096- } ) ;
1097+ } ) ;
1098+ } ) ;
10971099 }
10981100 } ) ;
10991101}
You can’t perform that action at this time.
0 commit comments