Fix build errors not caught by merge conflicts from #642

This commit is contained in:
Dustin Carlino 2021-05-14 08:37:46 -07:00
parent fd3b0e2a14
commit efd10ac9b0
4 changed files with 13 additions and 14 deletions

View File

@ -11,13 +11,11 @@ use crate::viewer::{draw_star, HoverKey, HoverOnBuilding};
use crate::App;
/// Calculate isochrones around each amenity on a map and merge them together using the min value
pub struct FindAmenity {
options: Options,
}
pub struct FindAmenity;
impl FindAmenity {
pub fn new(ctx: &mut EventCtx, options: Options) -> Box<dyn State<App>> {
ChooseSomething::new(
ChooseSomething::new_state(
ctx,
"Choose an amenity",
AmenityType::all()
@ -47,7 +45,7 @@ fn create_multi_isochrone(
stores.push(b.id);
}
}
Isochrone::new(ctx, app, stores, options.clone())
Isochrone::new(ctx, app, stores, options)
}
struct Results {
@ -63,7 +61,7 @@ impl Results {
isochrone: Isochrone,
category: AmenityType,
) -> Box<dyn State<App>> {
let panel = Panel::new(Widget::col(vec![
let panel = Panel::new_builder(Widget::col(vec![
Widget::row(vec![
Line(format!("{} within 15 minutes", category))
.small_heading()
@ -88,7 +86,7 @@ impl Results {
batch.append(draw_star(ctx, app.map.get_b(start)));
}
SimpleState::new(
<dyn SimpleState<_>>::new_state(
panel,
Box::new(Results {
draw: ctx.upload(batch),

View File

@ -74,11 +74,11 @@ impl DashTab {
summaries::TripSummaries::new_state(ctx, app, summaries::Filter::new())
}
DashTab::RiskSummaries => risks::RiskSummaries::new(ctx, app, false),
DashTab::ParkingOverhead => parking_overhead::ParkingOverhead::new(ctx, app),
DashTab::ActiveTraffic => misc::ActiveTraffic::new(ctx, app),
DashTab::TransitRoutes => misc::TransitRoutes::new(ctx, app),
DashTab::CommuterPatterns => CommuterPatterns::new(ctx, app),
DashTab::TrafficSignals => TrafficSignalDemand::new(ctx, app),
DashTab::ParkingOverhead => parking_overhead::ParkingOverhead::new_state(ctx, app),
DashTab::ActiveTraffic => misc::ActiveTraffic::new_state(ctx, app),
DashTab::TransitRoutes => misc::TransitRoutes::new_state(ctx, app),
DashTab::CommuterPatterns => CommuterPatterns::new_state(ctx, app),
DashTab::TrafficSignals => TrafficSignalDemand::new_state(ctx, app),
}))
}
}

View File

@ -25,7 +25,7 @@ impl RiskSummaries {
};
Box::new(RiskSummaries {
panel: Panel::new(Widget::col(vec![
panel: Panel::new_builder(Widget::col(vec![
DashTab::RiskSummaries.picker(ctx, app),
Widget::col(vec![
"Filters".text_widget(ctx),
@ -401,7 +401,7 @@ impl<X: Copy + PartialOrd + Display, Y: Copy + PartialOrd + Display> Matrix<X, Y
let mut chart = GeomBatchStack::vertical(vec![row.batch(), x_axis_label]);
chart.set_spacing(16);
DrawWithTooltips::new(ctx, chart.batch(), tooltips, Box::new(|_| GeomBatch::new()))
DrawWithTooltips::new_widget(ctx, chart.batch(), tooltips, Box::new(|_| GeomBatch::new()))
}
}

View File

@ -360,6 +360,7 @@ impl State<App> for TimeWarpScreen {
}
_ => unreachable!(),
}
_ => {}
}
if self.panel.clicked_outside(ctx) {
return Transition::Pop;