summaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/tui_footer.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:06:19 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:08:23 -0400
commit5be4a5f472655a76e1430bad09a19f6ad111e474 (patch)
tree1fcffa6c8d37cc6d538b29b6fbd773e8de58512d /src/ui/widgets/tui_footer.rs
parent4f3842b56f1729dcd8e81c77f98253ed9dfb23b3 (diff)
big rework and dependency update
- abstract JoshutoContext implementation behind functions - rework io workers in an attempt to fix a bug - update dependencies - remove JoshutoContextWorker
Diffstat (limited to 'src/ui/widgets/tui_footer.rs')
-rw-r--r--src/ui/widgets/tui_footer.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ui/widgets/tui_footer.rs b/src/ui/widgets/tui_footer.rs
index e8297ed..b9d3a08 100644
--- a/src/ui/widgets/tui_footer.rs
+++ b/src/ui/widgets/tui_footer.rs
@@ -1,7 +1,8 @@
use tui::buffer::Buffer;
use tui::layout::Rect;
use tui::style::{Color, Style};
-use tui::widgets::{Paragraph, Text, Widget};
+use tui::text::{Span, Spans};
+use tui::widgets::{Paragraph, Widget};
use crate::fs::{FileType, JoshutoDirEntry};
use crate::util::format;
@@ -38,22 +39,22 @@ impl<'a> Widget for TuiFooter<'a> {
};
let mut text = vec![
- Text::styled(mode, mode_style),
- Text::raw(" "),
- Text::raw(mtime),
- Text::raw(" "),
- Text::raw(size),
+ Span::styled(mode, mode_style),
+ Span::raw(" "),
+ Span::raw(mtime),
+ Span::raw(" "),
+ Span::raw(size),
#[cfg(unix)]
- Text::raw(" "),
+ Span::raw(" "),
#[cfg(unix)]
- Text::raw(mimetype),
+ Span::raw(mimetype),
];
if let FileType::Symlink(s) = &self.entry.metadata.file_type {
- text.push(Text::styled(" -> ", mode_style));
- text.push(Text::styled(s, mode_style));
+ text.push(Span::styled(" -> ", mode_style));
+ text.push(Span::styled(s, mode_style));
}
- Paragraph::new(text.iter()).wrap(true).render(area, buf);
+ Paragraph::new(Spans::from(text)).render(area, buf);
}
}