mirror of https://codeberg.org/topola/topola.git
42 lines
1.0 KiB
Rust
42 lines
1.0 KiB
Rust
use topola::autorouter::invoker::InvokerStatus;
|
|
|
|
use crate::{
|
|
activity::{ActivityStatus, ActivityWithStatus},
|
|
translator::Translator,
|
|
viewport::Viewport,
|
|
};
|
|
|
|
pub struct Bottom {}
|
|
|
|
impl Bottom {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
pub fn update(
|
|
&mut self,
|
|
ctx: &egui::Context,
|
|
tr: &Translator,
|
|
viewport: &Viewport,
|
|
maybe_activity: &Option<ActivityWithStatus>,
|
|
) {
|
|
egui::TopBottomPanel::bottom("bottom_panel").show(ctx, |ui| {
|
|
let latest_pos = viewport.transform.inverse()
|
|
* ctx.input(|i| i.pointer.latest_pos().unwrap_or_default());
|
|
|
|
let mut message = String::from("");
|
|
|
|
if let Some(activity) = maybe_activity {
|
|
if let Some(ActivityStatus::Finished(msg)) = activity.maybe_status() {
|
|
message = msg;
|
|
}
|
|
}
|
|
|
|
ui.label(format!(
|
|
"x: {} y: {} \t {}",
|
|
latest_pos.x, -latest_pos.y, message
|
|
));
|
|
});
|
|
}
|
|
}
|