diff --git a/locales/en-US/main.ftl b/locales/en-US/main.ftl index e8d8237..1d6d48d 100644 --- a/locales/en-US/main.ftl +++ b/locales/en-US/main.ftl @@ -1,4 +1,5 @@ menu-file = File +menu-options = Options menu-debug = Debug action-open-dsn = Open @@ -16,6 +17,8 @@ action-measure-length = Measure Length action-undo = Undo action-redo = Redo +presort-by-pairwise-detours = Presort by pairwise detours + show-ratsnest = Show Ratsnest show-navmesh = Show Navmesh show-bboxes = Show BBoxes diff --git a/src/bin/topola-egui/app.rs b/src/bin/topola-egui/app.rs index 1b340c5..700e82d 100644 --- a/src/bin/topola-egui/app.rs +++ b/src/bin/topola-egui/app.rs @@ -170,8 +170,6 @@ impl eframe::App for App { /// Called each time the UI has to be repainted. fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { - self.update_state(ctx.input(|i| i.stable_dt)); - self.top.update( ctx, &self.translator, @@ -183,6 +181,8 @@ impl eframe::App for App { &self.maybe_design, ); + self.update_state(ctx.input(|i| i.stable_dt)); + if let Some(ref mut layers) = self.maybe_layers { if let Some(invoker) = self.arc_mutex_maybe_invoker.lock().unwrap().as_ref() { layers.update(ctx, invoker.autorouter().board()); diff --git a/src/bin/topola-egui/top.rs b/src/bin/topola-egui/top.rs index e14406f..3210e0b 100644 --- a/src/bin/topola-egui/top.rs +++ b/src/bin/topola-egui/top.rs @@ -21,6 +21,7 @@ use crate::{ }; pub struct Top { + pub autorouter_options: AutorouterOptions, pub is_placing_via: bool, pub show_ratsnest: bool, pub show_navmesh: bool, @@ -31,6 +32,7 @@ pub struct Top { impl Top { pub fn new() -> Self { Self { + autorouter_options: AutorouterOptions::new(), is_placing_via: false, show_ratsnest: false, show_navmesh: false, @@ -135,6 +137,15 @@ impl Top { autoroute.button(ctx, ui); + ui.menu_button(tr.text("menu-options"), |ui| { + ui.checkbox( + &mut self.autorouter_options.presort_by_pairwise_detours, + tr.text("presort-by-pairwise-detours"), + ); + }); + + ui.separator(); + place_via.toggle_widget(ctx, ui, &mut self.is_placing_via); remove_bands.button(ctx, ui); @@ -252,7 +263,7 @@ impl Top { maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper( Command::Autoroute( selection.pin_selection, - AutorouterOptions::new(), + self.autorouter_options, ), )?)); } @@ -309,7 +320,7 @@ impl Top { maybe_execute.insert(ExecuteWithStatus::new(invoker.execute_stepper( Command::CompareDetours( selection.pin_selection, - AutorouterOptions::new(), + self.autorouter_options, ), )?)); }