Flesh out the UI for showing specific changed paths

This commit is contained in:
Dustin Carlino 2022-03-25 16:20:40 +00:00
parent 891ea04e90
commit 2e4e11f6b0
2 changed files with 14 additions and 3 deletions

View File

@ -242,13 +242,22 @@ impl ChangedRoutes {
.btn_prev() .btn_prev()
.hotkey(Key::LeftArrow) .hotkey(Key::LeftArrow)
.build_widget(ctx, "previous"), .build_widget(ctx, "previous"),
"path X/Y".text_widget(ctx).named("pointer").centered_vert(), "route X/Y"
.text_widget(ctx)
.named("pointer")
.centered_vert(),
ctx.style() ctx.style()
.btn_next() .btn_next()
.hotkey(Key::RightArrow) .hotkey(Key::RightArrow)
.build_widget(ctx, "next"), .build_widget(ctx, "next"),
]) ])
.evenly_spaced(), .evenly_spaced(),
Line("Route before any modal filters")
.fg(*colors::PLAN_ROUTE_BEFORE)
.into_widget(ctx),
Line("Route after modal filters")
.fg(*colors::PLAN_ROUTE_AFTER)
.into_widget(ctx),
])) ]))
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top) .aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
.build(ctx), .build(ctx),
@ -264,7 +273,7 @@ impl ChangedRoutes {
self.panel.replace( self.panel.replace(
ctx, ctx,
"pointer", "pointer",
format!("path {}/{}", self.current + 1, self.paths.len()).text_widget(ctx), format!("route {}/{}", self.current + 1, self.paths.len()).text_widget(ctx),
); );
let mut batch = GeomBatch::new(); let mut batch = GeomBatch::new();
@ -279,6 +288,8 @@ impl ChangedRoutes {
*colors::PLAN_ROUTE_AFTER, *colors::PLAN_ROUTE_AFTER,
pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS), pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS),
); );
batch.append(map_gui::tools::start_marker(ctx, pl.first_pt(), 2.0));
batch.append(map_gui::tools::goal_marker(ctx, pl.last_pt(), 2.0));
} }
self.draw_paths = ctx.upload(batch); self.draw_paths = ctx.upload(batch);
} }

View File

@ -1,6 +1,6 @@
use std::cell::RefCell; use std::cell::RefCell;
use geom::{Distance, PolyLine, Polygon, Pt2D}; use geom::{Distance, Polygon, Pt2D};
use map_model::{Building, LaneType, Map, Road, RoadID, NORMAL_LANE_THICKNESS}; use map_model::{Building, LaneType, Map, Road, RoadID, NORMAL_LANE_THICKNESS};
use widgetry::{Color, Drawable, GeomBatch, GfxCtx, Line, Prerender, Text}; use widgetry::{Color, Drawable, GeomBatch, GfxCtx, Line, Prerender, Text};