egui: add option to hide layer manager

This commit is contained in:
Mikolaj Wielgus 2024-09-11 21:47:44 +02:00
parent dc5693532b
commit 86b583e6c9
3 changed files with 15 additions and 5 deletions

View File

@ -5,8 +5,6 @@ menu-place = Place
menu-route = Route menu-route = Route
menu-inspect = Inspect menu-inspect = Inspect
menu-view-zoom-to-fit = Zoom to Fit
menu-options = Options menu-options = Options
menu-debug = Debug menu-debug = Debug
@ -29,9 +27,13 @@ presort-by-pairwise-detours = Presort by pairwise detours
squeeze-under-bands = Squeeze under bands squeeze-under-bands = Squeeze under bands
wrap-around-bands = Wrap around bands wrap-around-bands = Wrap around bands
zoom-to-fit = Zoom to Fit
show-ratsnest = Show Ratsnest show-ratsnest = Show Ratsnest
show-navmesh = Show Navmesh show-navmesh = Show Navmesh
show-bboxes = Show BBoxes show-bboxes = Show BBoxes
show-origin-destination = Show OriginDestination show-origin-destination = Show OriginDestination
show-layer-manager = Show Layer Manager
specctra-session-file = Specctra session file specctra-session-file = Specctra session file

View File

@ -187,9 +187,11 @@ impl eframe::App for App {
self.bottom self.bottom
.update(ctx, &self.translator, &self.viewport, &self.maybe_execute); .update(ctx, &self.translator, &self.viewport, &self.maybe_execute);
if let Some(ref mut layers) = self.maybe_layers { if self.top.show_layer_manager {
if let Some(invoker) = self.arc_mutex_maybe_invoker.lock().unwrap().as_ref() { if let Some(ref mut layers) = self.maybe_layers {
layers.update(ctx, invoker.autorouter().board()); if let Some(invoker) = self.arc_mutex_maybe_invoker.lock().unwrap().as_ref() {
layers.update(ctx, invoker.autorouter().board());
}
} }
} }

View File

@ -29,6 +29,7 @@ pub struct Top {
pub show_navmesh: bool, pub show_navmesh: bool,
pub show_bboxes: bool, pub show_bboxes: bool,
pub show_origin_destination: bool, pub show_origin_destination: bool,
pub show_layer_manager: bool,
} }
impl Top { impl Top {
@ -46,6 +47,7 @@ impl Top {
show_navmesh: false, show_navmesh: false,
show_bboxes: false, show_bboxes: false,
show_origin_destination: false, show_origin_destination: false,
show_layer_manager: true,
} }
} }
@ -166,6 +168,10 @@ impl Top {
&mut self.show_origin_destination, &mut self.show_origin_destination,
tr.text("show-origin-destination"), tr.text("show-origin-destination"),
); );
ui.separator();
ui.checkbox(&mut self.show_layer_manager, tr.text("show-layer-manager"));
}); });
ui.menu_button(tr.text("menu-place"), |ui| { ui.menu_button(tr.text("menu-place"), |ui| {