From e3db475be219025b2cd1427ed82a703d8e36eeeb Mon Sep 17 00:00:00 2001 From: edouard Date: Wed, 26 Apr 2023 20:57:40 +0200 Subject: [PATCH] gui: fix layout with scrollbar for big windows --- gui/src/app/view/mod.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/gui/src/app/view/mod.rs b/gui/src/app/view/mod.rs index 8c7e221a..bb68acf9 100644 --- a/gui/src/app/view/mod.rs +++ b/gui/src/app/view/mod.rs @@ -251,13 +251,17 @@ pub fn dashboard<'a, T: Into>>( Column::new() .push(warn(warning)) .push( - main_section(Container::new(scrollable(row!( + Container::new(scrollable(row!( Space::with_width(Length::FillPortion(1)), column!(Space::with_height(Length::Units(150)), content.into()) - .width(Length::FillPortion(8)), + .width(Length::FillPortion(8)) + .max_width(1500), Space::with_width(Length::FillPortion(1)), - )))) - .width(Length::Fill), + ))) + .center_x() + .style(theme::Container::Background) + .width(Length::Fill) + .height(Length::Fill), ) .width(Length::FillPortion(10)), ) @@ -266,14 +270,6 @@ pub fn dashboard<'a, T: Into>>( .into() } -fn main_section<'a, T: 'a>(menu: Container<'a, T>) -> Container<'a, T> { - Container::new(menu.max_width(1500)) - .style(theme::Container::Background) - .center_x() - .width(Length::Fill) - .height(Length::Fill) -} - pub fn modal<'a, T: Into>, F: Into>>( is_previous: bool, warning: Option<&Error>,