diff options
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)] |
