Remove rounding from new LTN panels. [rebuild] [release]

This commit is contained in:
Dustin Carlino 2022-03-13 11:02:58 +00:00
parent a266d91632
commit 0e04a29400

View File

@ -1,25 +1,34 @@
use geom::CornerRadii;
use widgetry::{
lctrl, EventCtx, HorizontalAlignment, Key, Line, Outcome, Panel, PanelBuilder, PanelDims,
VerticalAlignment, Widget,
lctrl, CornerRounding, EventCtx, HorizontalAlignment, Key, Line, Outcome, Panel, PanelBuilder,
PanelDims, VerticalAlignment, Widget,
};
use crate::{App, BrowseNeighborhoods, Transition};
pub fn app_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
Panel::new_builder(Widget::row(vec![
map_gui::tools::home_btn(ctx),
Line("Low traffic neighborhoods")
.small_heading()
.into_widget(ctx)
.centered_vert(),
map_gui::tools::change_map_btn(ctx, app).centered_vert(),
ctx.style()
.btn_plain
.icon("system/assets/tools/search.svg")
.hotkey(lctrl(Key::F))
.build_widget(ctx, "search")
.centered_vert(),
]))
Panel::new_builder(
Widget::row(vec![
map_gui::tools::home_btn(ctx),
Line("Low traffic neighborhoods")
.small_heading()
.into_widget(ctx)
.centered_vert(),
map_gui::tools::change_map_btn(ctx, app).centered_vert(),
ctx.style()
.btn_plain
.icon("system/assets/tools/search.svg")
.hotkey(lctrl(Key::F))
.build_widget(ctx, "search")
.centered_vert(),
])
.corner_rounding(CornerRounding::CornerRadii(CornerRadii {
top_left: 0.0,
bottom_left: 0.0,
bottom_right: 0.0,
top_right: 0.0,
})),
)
.aligned(HorizontalAlignment::Left, VerticalAlignment::Top)
.dims_width(PanelDims::ExactPercent(1.0))
.build(ctx)
@ -53,12 +62,19 @@ pub fn handle_top_panel(ctx: &mut EventCtx, app: &App, panel: &mut Panel) -> Opt
pub fn left_panel_builder(ctx: &EventCtx, top_panel: &Panel, contents: Widget) -> PanelBuilder {
let top_height = top_panel.panel_dims().height;
Panel::new_builder(contents)
.aligned(
HorizontalAlignment::Percent(0.0),
VerticalAlignment::Below(top_height),
)
.dims_height(PanelDims::ExactPixels(
ctx.canvas.window_height - top_height,
))
Panel::new_builder(
contents.corner_rounding(CornerRounding::CornerRadii(CornerRadii {
top_left: 0.0,
bottom_left: 0.0,
bottom_right: 0.0,
top_right: 0.0,
})),
)
.aligned(
HorizontalAlignment::Percent(0.0),
VerticalAlignment::Below(top_height),
)
.dims_height(PanelDims::ExactPixels(
ctx.canvas.window_height - top_height,
))
}