@@ -18,13 +18,16 @@ use time::UtcOffset;
1818use crate :: {
1919 app_config:: { deserialize_config, AppConfigVersion } ,
2020 config:: { build_globset, load_project_config, ProjectObject , ProjectObjectNode } ,
21+ diff:: DiffAlg ,
2122 jobs:: {
2223 objdiff:: { start_build, ObjDiffConfig } ,
2324 Job , JobQueue , JobResult , JobStatus ,
2425 } ,
2526 views:: {
2627 appearance:: { appearance_window, Appearance } ,
27- config:: { config_ui, project_window, ConfigViewState , DEFAULT_WATCH_PATTERNS } ,
28+ config:: {
29+ config_ui, diff_options_window, project_window, ConfigViewState , DEFAULT_WATCH_PATTERNS ,
30+ } ,
2831 data_diff:: data_diff_ui,
2932 demangle:: { demangle_window, DemangleViewState } ,
3033 function_diff:: function_diff_ui,
@@ -42,6 +45,7 @@ pub struct ViewState {
4245 pub show_appearance_config : bool ,
4346 pub show_demangle : bool ,
4447 pub show_project_config : bool ,
48+ pub show_diff_options : bool ,
4549}
4650
4751/// The configuration for a single object file.
@@ -98,6 +102,10 @@ pub struct AppConfig {
98102 pub watch_patterns : Vec < Glob > ,
99103 #[ serde( default ) ]
100104 pub recent_projects : Vec < PathBuf > ,
105+ #[ serde( default ) ]
106+ pub code_alg : DiffAlg ,
107+ #[ serde( default ) ]
108+ pub data_alg : DiffAlg ,
101109
102110 #[ serde( skip) ]
103111 pub objects : Vec < ProjectObject > ,
@@ -133,6 +141,8 @@ impl Default for AppConfig {
133141 auto_update_check : true ,
134142 watch_patterns : DEFAULT_WATCH_PATTERNS . iter ( ) . map ( |s| Glob :: new ( s) . unwrap ( ) ) . collect ( ) ,
135143 recent_projects : vec ! [ ] ,
144+ code_alg : Default :: default ( ) ,
145+ data_alg : Default :: default ( ) ,
136146 objects : vec ! [ ] ,
137147 object_nodes : vec ! [ ] ,
138148 watcher_change : false ,
@@ -398,6 +408,7 @@ impl eframe::App for App {
398408 diff_state,
399409 config_state,
400410 show_project_config,
411+ show_diff_options,
401412 } = view_state;
402413
403414 egui:: TopBottomPanel :: top ( "top_panel" ) . show ( ctx, |ui| {
@@ -443,6 +454,10 @@ impl eframe::App for App {
443454 }
444455 } ) ;
445456 ui. menu_button ( "Diff Options" , |ui| {
457+ if ui. button ( "Algorithm…" ) . clicked ( ) {
458+ * show_diff_options = !* show_diff_options;
459+ ui. close_menu ( ) ;
460+ }
446461 let mut config = config. write ( ) . unwrap ( ) ;
447462 let response = ui
448463 . checkbox ( & mut config. rebuild_on_changes , "Rebuild on changes" )
@@ -493,6 +508,7 @@ impl eframe::App for App {
493508 project_window ( ctx, config, show_project_config, config_state, appearance) ;
494509 appearance_window ( ctx, show_appearance_config, appearance) ;
495510 demangle_window ( ctx, show_demangle, demangle_state, appearance) ;
511+ diff_options_window ( ctx, config, show_diff_options, appearance) ;
496512
497513 self . post_update ( ) ;
498514
0 commit comments