From 86b583e6c9000d96042b3e32d7ba34df1b272689 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Wed, 11 Sep 2024 21:47:44 +0200 Subject: [PATCH] egui: add option to hide layer manager --- locales/en-US/main.ftl | 6 ++++-- src/bin/topola-egui/app.rs | 8 +++++--- src/bin/topola-egui/top.rs | 6 ++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/locales/en-US/main.ftl b/locales/en-US/main.ftl index bd63721..311f176 100644 --- a/locales/en-US/main.ftl +++ b/locales/en-US/main.ftl @@ -5,8 +5,6 @@ menu-place = Place menu-route = Route menu-inspect = Inspect -menu-view-zoom-to-fit = Zoom to Fit - menu-options = Options menu-debug = Debug @@ -29,9 +27,13 @@ presort-by-pairwise-detours = Presort by pairwise detours squeeze-under-bands = Squeeze under bands wrap-around-bands = Wrap around bands +zoom-to-fit = Zoom to Fit + show-ratsnest = Show Ratsnest show-navmesh = Show Navmesh show-bboxes = Show BBoxes show-origin-destination = Show Origin–Destination +show-layer-manager = Show Layer Manager + specctra-session-file = Specctra session file diff --git a/src/bin/topola-egui/app.rs b/src/bin/topola-egui/app.rs index 6b4142e..3626ddf 100644 --- a/src/bin/topola-egui/app.rs +++ b/src/bin/topola-egui/app.rs @@ -187,9 +187,11 @@ impl eframe::App for App { self.bottom .update(ctx, &self.translator, &self.viewport, &self.maybe_execute); - 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()); + if self.top.show_layer_manager { + 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 dd713f6..ee2151f 100644 --- a/src/bin/topola-egui/top.rs +++ b/src/bin/topola-egui/top.rs @@ -29,6 +29,7 @@ pub struct Top { pub show_navmesh: bool, pub show_bboxes: bool, pub show_origin_destination: bool, + pub show_layer_manager: bool, } impl Top { @@ -46,6 +47,7 @@ impl Top { show_navmesh: false, show_bboxes: false, show_origin_destination: false, + show_layer_manager: true, } } @@ -166,6 +168,10 @@ impl Top { &mut self.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| {