diff options
Diffstat (limited to 'src/widgets/statusbar.rs')
| -rw-r--r-- | src/widgets/statusbar.rs | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/src/widgets/statusbar.rs b/src/widgets/statusbar.rs index c8d52e5..61ce1a3 100644 --- a/src/widgets/statusbar.rs +++ b/src/widgets/statusbar.rs @@ -1,3 +1,4 @@ + use ratatui::{ crossterm::event::{KeyCode, KeyEvent}, layout::{Alignment, Rect}, @@ -6,7 +7,7 @@ use ratatui::{ widgets::Widget, }; -#[derive(Clone, Default)] +#[derive(Clone, Default, Debug)] pub struct StatusBar { left: String, left_style: Style, @@ -34,50 +35,6 @@ impl StatusBar { } } - pub fn left<S>(mut self, text: S) -> Self - where - S: AsRef<str>, - { - self.left = text.as_ref().to_string(); - self - } - - pub fn middle<S>(mut self, text: S) -> Self - where - S: AsRef<str>, - { - self.middle = text.as_ref().to_string(); - self - } - - pub fn right<S>(mut self, text: S) -> Self - where - S: AsRef<str>, - { - self.right = text.as_ref().to_string(); - self - } - - pub fn left_style(mut self, style: Style) -> Self { - self.left_style = style; - self - } - - pub fn middle_style(mut self, style: Style) -> Self { - self.left_style = style; - self - } - - pub fn middle_alignment(mut self, alignment: Alignment) -> Self { - self.middle_alignment = alignment; - self - } - - pub fn right_style(mut self, style: Style) -> Self { - self.right_style = style; - self - } - pub fn set_left<S>(&mut self, text: S) where S: AsRef<str>, @@ -104,7 +61,7 @@ impl StatusBar { } pub fn set_middle_style(&mut self, style: Style) { - self.left_style = style; + self.middle_style = style; } pub fn set_right_style(&mut self, style: Style) { |