From c0fe7428102537b4e45f6ce8a2bd7051ed65f35a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 27 Feb 2021 09:41:31 -0800 Subject: [PATCH] section styling for lane panel --- game/src/info/lane.rs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/game/src/info/lane.rs b/game/src/info/lane.rs index 515c3a97c3..0447fe58a8 100644 --- a/game/src/info/lane.rs +++ b/game/src/info/lane.rs @@ -3,7 +3,7 @@ use std::collections::HashSet; use abstutil::prettyprint_usize; use map_model::{LaneID, PathConstraints}; use widgetry::{ - EventCtx, Line, LinePlot, PlotOptions, Series, StyledButtons, Text, TextExt, Widget, + Color, EventCtx, Line, LinePlot, PlotOptions, Series, StyledButtons, Text, TextExt, Widget, }; use crate::app::App; @@ -81,17 +81,23 @@ pub fn info(ctx: &EventCtx, app: &App, details: &mut Details, id: LaneID) -> Vec ), }); } - rows.push("Parking spots available".draw_text(ctx)); - rows.push(LinePlot::new( - ctx, - series, - PlotOptions { - filterable: false, - max_x: None, - max_y: Some(capacity), - disabled: HashSet::new(), - }, - )); + let section = Widget::col(vec![ + Line("Parking spots available").small_heading().draw(ctx), + LinePlot::new( + ctx, + series, + PlotOptions { + filterable: false, + max_x: None, + max_y: Some(capacity), + disabled: HashSet::new(), + }, + ), + ]) + .padding(10) + .bg(app.cs.inner_panel_bg) + .outline(2.0, Color::WHITE); + rows.push(section); } rows