style parking lot info like other info panels

This commit is contained in:
Michael Kirk 2021-02-24 20:14:36 -08:00 committed by Dustin Carlino
parent a085db301b
commit 494be704da

View File

@ -2,7 +2,9 @@ use std::collections::HashSet;
use abstutil::prettyprint_usize;
use map_model::ParkingLotID;
use widgetry::{EventCtx, Line, LinePlot, PlotOptions, Series, StyledButtons, TextExt, Widget};
use widgetry::{
Color, EventCtx, Line, LinePlot, PlotOptions, Series, StyledButtons, TextExt, Widget,
};
use crate::app::App;
use crate::info::{header_btns, make_tabs, Details, Tab};
@ -41,17 +43,24 @@ pub fn info(ctx: &mut EventCtx, app: &App, details: &mut Details, id: ParkingLot
),
});
}
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);
if app.opts.dev {
rows.push(