Setting column align and visibility.
authorAndrea Zagli <azagli@libero.it>
Mon, 2 Jan 2023 15:36:45 +0000 (16:36 +0100)
committerAndrea Zagli <azagli@libero.it>
Mon, 2 Jan 2023 15:36:45 +0000 (16:36 +0100)
src/lib.rs

index 44465dc99a58c40231b396f3c2c6625ddd690dc4..5cf721a05bfa63bccd8778a90113761a977692eb 100644 (file)
@@ -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 {