diff options
| author | Joe Carstairs <me@joeac.net> | 2026-02-12 10:10:27 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-02-12 10:10:27 +0000 |
| commit | 8f57c4a25e6eb109259a082cd4f1e1007ad4044c (patch) | |
| tree | a8ad35c85b9f3f5383b09df2b3191606330bcaaf /schist_desktop_gui/src/gui/components/table | |
| parent | 921b52d1aa05fd6477bab56ba7dab1ab9d699b42 (diff) | |
task-085: each column has its own width
Diffstat (limited to 'schist_desktop_gui/src/gui/components/table')
| -rw-r--r-- | schist_desktop_gui/src/gui/components/table/view_table.rs | 9 |
1 files changed, 4 insertions, 5 deletions
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(), |
