summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/table.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-02-12 10:10:27 +0000
committerJoe Carstairs <me@joeac.net>2026-02-12 10:10:27 +0000
commit8f57c4a25e6eb109259a082cd4f1e1007ad4044c (patch)
treea8ad35c85b9f3f5383b09df2b3191606330bcaaf /schist_desktop_gui/src/gui/components/table.rs
parent921b52d1aa05fd6477bab56ba7dab1ab9d699b42 (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.rs13
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)]