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.rs | |
| parent | 921b52d1aa05fd6477bab56ba7dab1ab9d699b42 (diff) | |
task-085: each column has its own width
Diffstat (limited to 'schist_desktop_gui/src/gui/components/table.rs')
| -rw-r--r-- | schist_desktop_gui/src/gui/components/table.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/table.rs b/schist_desktop_gui/src/gui/components/table.rs index 4c6d810..68090c1 100644 --- a/schist_desktop_gui/src/gui/components/table.rs +++ b/schist_desktop_gui/src/gui/components/table.rs @@ -24,6 +24,7 @@ where { pub index: Ix, pub name: String, + pub width: f32, } impl<Ix> Column<Ix> @@ -34,8 +35,20 @@ where Self { index, name: name.to_string(), + width: 128.0, } } + + pub fn width(&self, width: f32) -> Self { + Self { + width, + ..self.clone() + } + } + + pub fn mul_width(&self, mul: f32) -> Self { + self.width(self.width * mul) + } } #[derive(Clone, Debug)] |
