From 8f57c4a25e6eb109259a082cd4f1e1007ad4044c Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 12 Feb 2026 10:10:27 +0000 Subject: task-085: each column has its own width --- schist_desktop_gui/src/gui/components/table/view_table.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'schist_desktop_gui/src/gui/components/table') diff --git a/schist_desktop_gui/src/gui/components/table/view_table.rs b/schist_desktop_gui/src/gui/components/table/view_table.rs index 33fa0ef..81755dc 100644 --- a/schist_desktop_gui/src/gui/components/table/view_table.rs +++ b/schist_desktop_gui/src/gui/components/table/view_table.rs @@ -15,11 +15,10 @@ where fn view(&'a self) -> iced::Element<'a, Message> { let headers = row(self.cols.iter().map(|col| { container(Text::default(&col.name)) - .width(iced::Length::Fixed(128.0)) + .width(iced::Length::Fixed(col.width)) .into() })) - .spacing(SPACING_MD) - .padding(SPACING_MD); + .spacing(SPACING_MD); let rows = column(self.rows.iter().map(|row_data| { row(self.cols.iter().map(|col| { @@ -32,14 +31,14 @@ where }) .unwrap_or_else(|| Text::default("")), ) - .width(iced::Length::Fixed(128.0)) + .width(iced::Length::Fixed(col.width)) .into() })) .spacing(SPACING_MD) .into() })); - scrollable(column![headers, rows]) + scrollable(column![headers, rows].spacing(SPACING_MD)) .direction(ScrollableDirection::Both { horizontal: Default::default(), vertical: Default::default(), -- cgit v1.2.3