From 33645df70443a86ab30e531d9f33eff4b032f234 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 2 Jan 2023 16:36:45 +0100 Subject: [PATCH] Setting column align and visibility. --- src/lib.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 44465dc..5cf721a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,11 @@ use serde_derive::Serialize; use tera::Tera; -#[derive(Debug, Serialize)] +#[derive(Copy, Clone, Serialize)] pub enum Align { Left, Center, - Right + Right, } pub struct Column { @@ -36,6 +36,22 @@ impl Column { pub fn title(&self) -> String { format!("{}", self.title) } + + pub fn set_align(&mut self, align: Align) { + self.align = align; + } + + pub fn align(&self) -> Align { + self.align + } + + pub fn set_hidden(&mut self, hidden: bool) { + self.hidden = hidden; + } + + pub fn hidden(&self) -> bool { + self.hidden + } } pub struct Grid { -- 2.49.0