diff --git a/src/bin/topola-egui/action.rs b/src/bin/topola-egui/action.rs index 60fcbdb..da4294f 100644 --- a/src/bin/topola-egui/action.rs +++ b/src/bin/topola-egui/action.rs @@ -33,7 +33,7 @@ impl Trigger { } } - pub fn button(&mut self, ctx: &egui::Context, ui: &mut egui::Ui) { + pub fn button(&mut self, _ctx: &egui::Context, ui: &mut egui::Ui) { self.triggered = ui.button(self.action.widget_text()).clicked(); } @@ -42,7 +42,7 @@ impl Trigger { self.triggered() } - fn consume_key(&mut self, ctx: &egui::Context, ui: &mut egui::Ui) { + fn consume_key(&mut self, ctx: &egui::Context, _ui: &mut egui::Ui) { if ctx.input_mut(|i| i.consume_shortcut(&self.action.shortcut)) { self.triggered = true; } @@ -62,14 +62,14 @@ impl Switch { Self { action } } - pub fn toggle_widget(&mut self, ctx: &egui::Context, ui: &mut egui::Ui, selected: &mut bool) { + pub fn toggle_widget(&mut self, _ctx: &egui::Context, ui: &mut egui::Ui, selected: &mut bool) { ui.toggle_value(selected, self.action.widget_text()); } pub fn consume_key_enabled( &mut self, ctx: &egui::Context, - ui: &mut egui::Ui, + _ui: &mut egui::Ui, selected: &mut bool, ) -> bool { if ctx.input_mut(|i| i.consume_shortcut(&self.action.shortcut)) { diff --git a/src/bin/topola-egui/activity.rs b/src/bin/topola-egui/activity.rs index d78ec32..5c29027 100644 --- a/src/bin/topola-egui/activity.rs +++ b/src/bin/topola-egui/activity.rs @@ -7,7 +7,6 @@ use topola::{ InvokerStatus, }, }, - board::mesadata::AccessMesadata, drawing::graph::PrimitiveIndex, geometry::primitive::PrimitiveShape, router::{navmesh::Navmesh, trace::TraceStepper}, diff --git a/src/bin/topola-egui/app.rs b/src/bin/topola-egui/app.rs index 42d306a..0ff3d04 100644 --- a/src/bin/topola-egui/app.rs +++ b/src/bin/topola-egui/app.rs @@ -1,8 +1,5 @@ -use geo::point; -use petgraph::visit::{EdgeRef, IntoEdgeReferences}; use serde::{Deserialize, Serialize}; use std::{ - fs::File, future::Future, sync::{ mpsc::{channel, Receiver, Sender}, @@ -13,27 +10,6 @@ use unic_langid::{langid, LanguageIdentifier}; use topola::{ autorouter::{invoker::Invoker, Autorouter}, - drawing::{ - dot::FixedDotIndex, - graph::{MakePrimitive, PrimitiveIndex}, - primitive::MakePrimitiveShape, - rules::AccessRules, - Drawing, DrawingException, Infringement, - }, - geometry::{ - compound::ManageCompounds, - primitive::{AccessPrimitiveShape, BendShape, DotShape, PrimitiveShape, SegShape}, - shape::AccessShape, - GenericNode, - }, - layout::{poly::MakePolyShape, via::ViaWeight, Layout}, - math::Circle, - router::{ - draw::DrawException, - navmesh::{BinavvertexNodeIndex, Navmesh}, - trace::TraceStepper, - tracer::Tracer, - }, specctra::{design::SpecctraDesign, mesadata::SpecctraMesadata}, }; @@ -44,7 +20,6 @@ use crate::{ layers::Layers, menu_bar::MenuBar, overlay::Overlay, - painter::Painter, status_bar::StatusBar, translator::Translator, viewport::Viewport, @@ -250,10 +225,9 @@ impl eframe::App for App { } } - self.error_dialog - .update(ctx, &self.translator, &self.viewport); + self.error_dialog.update(ctx, &self.translator); - let viewport_rect = self.viewport.update( + let _viewport_rect = self.viewport.update( ctx, &self.top, &mut self.arc_mutex_maybe_invoker.lock().unwrap(), diff --git a/src/bin/topola-egui/error_dialog.rs b/src/bin/topola-egui/error_dialog.rs index 8957ada..3a5adf4 100644 --- a/src/bin/topola-egui/error_dialog.rs +++ b/src/bin/topola-egui/error_dialog.rs @@ -1,10 +1,9 @@ //! dialog for error messages (e.g. for displaying file parser errors) +use crate::translator::Translator; use std::collections::BTreeSet; use std::sync::Arc; -use crate::{translator::Translator, viewport::Viewport}; - pub struct ErrorDialog { /// messages is a list of error messages to display. /// @@ -32,7 +31,7 @@ impl ErrorDialog { self.window_open = true; } - pub fn update(&mut self, ctx: &egui::Context, tr: &Translator, viewport: &Viewport) { + pub fn update(&mut self, ctx: &egui::Context, tr: &Translator) { let mut messages_cleared = false; egui::Window::new(tr.text("title-error-messages")) .id("error-messages-dialog".into()) @@ -48,10 +47,12 @@ impl ErrorDialog { let mut messages_to_discard = BTreeSet::::new(); let style = Arc::clone(ui.style()); for (msg_id, msg) in self.messages.iter().enumerate() { - use egui::style::{FontSelection, TextStyle}; - use egui::text::{LayoutJob, TextWrapping}; - use egui::widget_text::{RichText, WidgetText}; - use egui::{Align, FontFamily, FontId, TextFormat}; + use egui::{ + style::{FontSelection, TextStyle}, + text::LayoutJob, + widget_text::{RichText, WidgetText}, + Align, + }; let mut loj = LayoutJob::default(); loj.break_on_newline = true; diff --git a/src/bin/topola-egui/main.rs b/src/bin/topola-egui/main.rs index edb15da..0a87eba 100644 --- a/src/bin/topola-egui/main.rs +++ b/src/bin/topola-egui/main.rs @@ -15,9 +15,8 @@ mod translator; mod viewport; use app::App; -use fluent_templates::static_loader; use sys_locale::get_locale; -use unic_langid::{langid, LanguageIdentifier}; +use unic_langid::langid; // Build to native. #[cfg(not(target_arch = "wasm32"))] diff --git a/src/bin/topola-egui/menu_bar.rs b/src/bin/topola-egui/menu_bar.rs index 380f3a1..f87cfd4 100644 --- a/src/bin/topola-egui/menu_bar.rs +++ b/src/bin/topola-egui/menu_bar.rs @@ -1,5 +1,4 @@ use std::{ - fs::File, path::Path, sync::{mpsc::Sender, Arc, Mutex}, }; @@ -7,7 +6,7 @@ use std::{ use topola::{ autorouter::{ command::Command, - invoker::{Invoker, InvokerError, InvokerStatus}, + invoker::{Invoker, InvokerError}, AutorouterOptions, }, router::RouterOptions, diff --git a/src/bin/topola-egui/overlay.rs b/src/bin/topola-egui/overlay.rs index 78fac41..394cfc4 100644 --- a/src/bin/topola-egui/overlay.rs +++ b/src/bin/topola-egui/overlay.rs @@ -1,5 +1,3 @@ -use std::collections::HashSet; - use geo::Point; use rstar::AABB; use spade::InsertionError; @@ -17,9 +15,9 @@ use topola::{ }, graph::{GenericIndex, GetPetgraphIndex}, layout::{ - poly::{MakePolyShape, Poly, PolyWeight}, + poly::{MakePolyShape, PolyWeight}, via::ViaWeight, - CompoundWeight, Layout, NodeIndex, + CompoundWeight, NodeIndex, }, }; @@ -61,7 +59,7 @@ impl Overlay { } NodeIndex::Compound(compound) => { match board.layout().drawing().compound_weight(compound) { - CompoundWeight::Poly(weight) => { + CompoundWeight::Poly(_) => { board .layout() .poly(GenericIndex::::new( @@ -94,12 +92,12 @@ impl Overlay { } NodeIndex::Compound(compound) => { match board.layout().drawing().compound_weight(compound) { - CompoundWeight::Poly(weight) => board + CompoundWeight::Poly(_) => board .layout() .poly(GenericIndex::::new(compound.petgraph_index())) .shape() .into(), - CompoundWeight::Via(weight) => board + CompoundWeight::Via(_) => board .layout() .via(GenericIndex::::new(compound.petgraph_index())) .shape() diff --git a/src/bin/topola-egui/painter.rs b/src/bin/topola-egui/painter.rs index 30ec427..87f06f9 100644 --- a/src/bin/topola-egui/painter.rs +++ b/src/bin/topola-egui/painter.rs @@ -2,7 +2,7 @@ use geo::{CoordsIter, Point, Polygon}; use rstar::AABB; use topola::{ geometry::primitive::{AccessPrimitiveShape, PrimitiveShape}, - math::{self, Circle}, + math::Circle, }; pub struct Painter<'a> { diff --git a/src/bin/topola-egui/status_bar.rs b/src/bin/topola-egui/status_bar.rs index 097ffc3..f2996bc 100644 --- a/src/bin/topola-egui/status_bar.rs +++ b/src/bin/topola-egui/status_bar.rs @@ -1,5 +1,3 @@ -use topola::autorouter::invoker::InvokerStatus; - use crate::{ activity::{ActivityStatus, ActivityWithStatus}, translator::Translator, diff --git a/src/bin/topola-egui/viewport.rs b/src/bin/topola-egui/viewport.rs index aadceb7..8061e85 100644 --- a/src/bin/topola-egui/viewport.rs +++ b/src/bin/topola-egui/viewport.rs @@ -9,7 +9,6 @@ use topola::{ command::Command, invoker::{GetGhosts, GetMaybeNavmesh, GetMaybeTrace, GetObstacles, Invoker}, }, - board::mesadata::AccessMesadata, drawing::{ graph::{MakePrimitive, PrimitiveIndex}, primitive::MakePrimitiveShape, @@ -21,8 +20,8 @@ use topola::{ }; use crate::{ - activity::ActivityWithStatus, app::execute, layers::Layers, menu_bar::MenuBar, - overlay::Overlay, painter::Painter, + activity::ActivityWithStatus, layers::Layers, menu_bar::MenuBar, overlay::Overlay, + painter::Painter, }; pub struct Viewport { @@ -253,22 +252,21 @@ impl Viewport { if let Some(navmesh) = activity.maybe_navmesh() { if top.show_origin_destination { - if let (origin, destination) = (navmesh.origin(), navmesh.destination()) { - painter.paint_dot( - Circle { - pos: board.layout().drawing().primitive(origin).shape().center(), - r: 150.0, - }, - egui::Color32::from_rgb(255, 255, 100), - ); - painter.paint_dot( - Circle { - pos: board.layout().drawing().primitive(destination).shape().center(), - r: 150.0, - }, - egui::Color32::from_rgb(255, 255, 100), - ); - } + let (origin, destination) = (navmesh.origin(), navmesh.destination()); + painter.paint_dot( + Circle { + pos: board.layout().drawing().primitive(origin).shape().center(), + r: 150.0, + }, + egui::Color32::from_rgb(255, 255, 100), + ); + painter.paint_dot( + Circle { + pos: board.layout().drawing().primitive(destination).shape().center(), + r: 150.0, + }, + egui::Color32::from_rgb(255, 255, 100), + ); } } }