diff --git a/src/compare.rs b/src/compare.rs index 26a361b..fa83bd5 100644 --- a/src/compare.rs +++ b/src/compare.rs @@ -1,13 +1,16 @@ -use std::{collections::BTreeMap, cmp::Ordering, iter}; +use std::{cmp::Ordering, collections::BTreeMap, iter}; use iced::{ - widget::{column, component, row, text, Row, horizontal_rule, Column, vertical_rule, container, button}, + widget::{ + button, column, component, container, horizontal_rule, row, scrollable, text, + vertical_rule, Column, Row, + }, Alignment, Length, Renderer, }; -use iced_aw::{selection_list, card, modal}; +use iced_aw::{card, modal, selection_list}; use itertools::Itertools; -use crate::{CompareLoad, CompareSide, ReportDate, Spendings, TEXT_H2, TEXT_H1, TEXT_EMPH2}; +use crate::{CompareLoad, CompareSide, ReportDate, Spendings, TEXT_EMPH2, TEXT_H1, TEXT_H2}; pub(crate) struct Compare { pub left: Option<(CompareLoad, Box)>, @@ -243,7 +246,7 @@ where compare } - table::<_, _, iced::Element<_>, _>( + scrollable(table::<_, _, iced::Element<_>, _>( properties, itertools::chain![ iter::once(headings), @@ -252,7 +255,7 @@ where iter::once(mk_section("Variable")), item_compare(left.map(|r| r.variable()), right.map(|r| r.variable())), ], - ) + )) .into() } } @@ -294,7 +297,7 @@ where .zip(props.iter()) .map(|(col, prop)| { Column::with_children(col) - .height(Length::Fill) + .height(Length::Shrink) .width(prop.width) .max_width(prop.max_width) .align_items(prop.align) @@ -302,8 +305,9 @@ where }) .intersperse_with(|| { container(vertical_rule(0.)) - .height(Length::Fill) .width(Length::Shrink) + .max_height(1000.0) + .height(Length::Fill) .center_y() .into() })