From 0e04a294009661be763210bdccf4ebd4bfcd0d5c Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sun, 13 Mar 2022 11:02:58 +0000 Subject: [PATCH] Remove rounding from new LTN panels. [rebuild] [release] --- apps/ltn/src/common/mod.rs | 64 ++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/apps/ltn/src/common/mod.rs b/apps/ltn/src/common/mod.rs index 4dea7604a0..f8e71362a7 100644 --- a/apps/ltn/src/common/mod.rs +++ b/apps/ltn/src/common/mod.rs @@ -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, + )) }