@@ -6,7 +6,7 @@ use egui::{
66} ;
77use objdiff_core:: {
88 diff:: {
9- ObjectDiff , SymbolDiff ,
9+ DiffObjConfig , ObjectDiff , ShowSymbolSizes , SymbolDiff ,
1010 display:: {
1111 HighlightKind , SectionDisplay , SymbolFilter , SymbolNavigationKind , display_sections,
1212 symbol_context, symbol_hover,
@@ -525,6 +525,7 @@ fn symbol_ui(
525525 state : & SymbolViewState ,
526526 appearance : & Appearance ,
527527 column : usize ,
528+ diff_config : & DiffObjConfig ,
528529) -> Option < DiffViewAction > {
529530 let mut ret = None ;
530531 let mut job = LayoutJob :: default ( ) ;
@@ -572,6 +573,21 @@ fn symbol_ui(
572573 write_text ( ") " , appearance. text_color , & mut job, appearance. code_font . clone ( ) ) ;
573574 }
574575 write_text ( name, appearance. highlight_color , & mut job, appearance. code_font . clone ( ) ) ;
576+ if diff_config. show_symbol_sizes == ShowSymbolSizes :: Decimal {
577+ write_text (
578+ & format ! ( " (size={})" , symbol. size) ,
579+ appearance. deemphasized_text_color ,
580+ & mut job,
581+ appearance. code_font . clone ( ) ,
582+ ) ;
583+ } else if diff_config. show_symbol_sizes == ShowSymbolSizes :: Hex {
584+ write_text (
585+ & format ! ( " (size={:x})" , symbol. size) ,
586+ appearance. deemphasized_text_color ,
587+ & mut job,
588+ appearance. code_font . clone ( ) ,
589+ ) ;
590+ }
575591 let response = egui:: Button :: selectable ( selected, job)
576592 . ui ( ui)
577593 . on_hover_ui_at_pointer ( |ui| symbol_hover_ui ( ui, ctx, symbol_idx, appearance) ) ;
@@ -646,6 +662,7 @@ pub fn symbol_list_ui(
646662 appearance : & Appearance ,
647663 column : usize ,
648664 open_sections : Option < bool > ,
665+ diff_config : & DiffObjConfig ,
649666) -> Option < DiffViewAction > {
650667 let mut ret = None ;
651668 ScrollArea :: both ( ) . auto_shrink ( [ false , false ] ) . show ( ui, |ui| {
@@ -770,6 +787,7 @@ pub fn symbol_list_ui(
770787 state,
771788 appearance,
772789 column,
790+ diff_config,
773791 ) {
774792 ret = Some ( result) ;
775793 }
0 commit comments