From 497d05552a840c6fdcc9841b8c78b0a570ed90a6 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 16 Jan 2020 15:34:30 -0800 Subject: [PATCH] use a locate icon button in a few places --- game/assets/tools/locate.svg | 5 +++++ game/src/sandbox/overlays.rs | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 game/assets/tools/locate.svg diff --git a/game/assets/tools/locate.svg b/game/assets/tools/locate.svg new file mode 100644 index 0000000000..cdbca0dbf9 --- /dev/null +++ b/game/assets/tools/locate.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/game/src/sandbox/overlays.rs b/game/src/sandbox/overlays.rs index 1cee1dc096..40a1193d79 100644 --- a/game/src/sandbox/overlays.rs +++ b/game/src/sandbox/overlays.rs @@ -561,8 +561,14 @@ impl Overlays { } let mut col = vec![ManagedWidget::row(vec![ - // TODO Say which intersection? And have a location icon to jump to it - crate::managed::Composite::text_button(ctx, "intersection demand", None), + ManagedWidget::draw_text(ctx, Text::from(Line("intersection demand"))), + ManagedWidget::btn(Button::rectangle_svg( + "assets/tools/locate.svg", + "intersection demand", + None, + RewriteColor::Change(Color::hex("#CC4121"), Color::ORANGE), + ctx, + )), crate::managed::Composite::text_button(ctx, "X", None).align_right(), ])]; col.extend(ColorLegend::rows(ctx, vec![("current demand", Color::RED)])); @@ -595,13 +601,16 @@ impl Overlays { .get_analytics() .bus_passenger_delays(ui.primary.sim.time(), id); for idx in 0..route.stops.len() { - let mut row = vec![ManagedWidget::btn(Button::text_no_bg( - Text::from(Line(format!("Stop {}", idx + 1))), - Text::from(Line(format!("Stop {}", idx + 1)).fg(Color::ORANGE)), - None, - &format!("Stop {}", idx + 1), - ctx, - ))]; + let mut row = vec![ + ManagedWidget::draw_text(ctx, Text::from(Line(format!("Stop {}", idx + 1)))), + ManagedWidget::btn(Button::rectangle_svg( + "assets/tools/locate.svg", + &format!("Stop {}", idx + 1), + None, + RewriteColor::Change(Color::hex("#CC4121"), Color::ORANGE), + ctx, + )), + ]; if let Some(hgram) = delay_per_stop.remove(&route.stops[idx]) { row.push(ManagedWidget::draw_text( ctx,