diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/footer.rs | 20 | ||||
-rw-r--r-- | src/render/tasks.rs | 34 |
2 files changed, 0 insertions, 54 deletions
diff --git a/src/render/footer.rs b/src/render/footer.rs deleted file mode 100644 index 9e74de8..0000000 --- a/src/render/footer.rs +++ /dev/null @@ -1,20 +0,0 @@ -use ratatui::{style::{Modifier, Style}, widgets::{Paragraph, Widget}}; - - -#[derive(Debug, Default)] -pub struct Footer; - -impl Footer { - pub fn new() -> Footer { - return Footer {} - } -} - -impl Widget for &Footer { - - fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) { - Paragraph::new("hellow") - .style(Style::default().add_modifier(Modifier::REVERSED)) - .render(area, buf); - } -} diff --git a/src/render/tasks.rs b/src/render/tasks.rs deleted file mode 100644 index 0f6a79a..0000000 --- a/src/render/tasks.rs +++ /dev/null @@ -1,34 +0,0 @@ -use ratatui::{layout::Constraint, widgets::{Row, Table, Widget}, prelude::Text}; - -use crate::model::Task; - - - -#[derive(Debug)] -pub struct TaskList<'a> { - tasks: &'a[Task] -} - -impl<'a> TaskList<'a> { - pub fn new(tasks: &'a[Task]) -> TaskList<'a> { - TaskList { - tasks - } - } -} - -impl<'a> Widget for &TaskList<'a> { - fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) { - let rows: Vec<Row> = self.tasks.into_iter() - .map(|t: &Task| Row::new(vec![Text::from(t.name.as_str()), Text::from(t.description.as_str())])) - .collect(); - - let widths = [ - Constraint::Percentage(50), - Constraint::Fill(1), - ]; - - Table::new(rows, widths) - .render(area, buf); - } -} |