diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-04-03 09:53:39 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-04-03 09:53:39 -0400 |
commit | 771a8b86133be492620a439fe9cabc2dbd80dc33 (patch) | |
tree | 8aadd4e518d4f2135244a14bff6a5cf093990159 /src/ui | |
parent | 77685885d5f8a8dfd1889245cf1bd6d783503620 (diff) |
updates
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/tui_backend.rs | 4 | ||||
-rw-r--r-- | src/ui/widgets/tui_dirlist_detailed.rs | 1 | ||||
-rw-r--r-- | src/ui/widgets/tui_view.rs | 8 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/tui_backend.rs b/src/ui/tui_backend.rs index 7d3a7f3..a7d7152 100644 --- a/src/ui/tui_backend.rs +++ b/src/ui/tui_backend.rs @@ -14,8 +14,8 @@ pub struct TuiBackend { impl TuiBackend { pub fn new() -> std::io::Result<Self> { let stdout = std::io::stdout().into_raw_mode()?; - let stdout = AlternateScreen::from(stdout); - let backend = TermionBackend::new(stdout); + let alt_screen = AlternateScreen::from(stdout); + let backend = TermionBackend::new(alt_screen); let mut terminal = tui::Terminal::new(backend)?; terminal.hide_cursor()?; Ok(Self { diff --git a/src/ui/widgets/tui_dirlist_detailed.rs b/src/ui/widgets/tui_dirlist_detailed.rs index ac7da28..1e40cbd 100644 --- a/src/ui/widgets/tui_dirlist_detailed.rs +++ b/src/ui/widgets/tui_dirlist_detailed.rs @@ -68,6 +68,7 @@ impl<'a> Widget for TuiDirListDetailed<'a> { buf.set_stringn(x, y + i as u16, name, area_width - 1, style); buf.set_string(x + area_width as u16 - 1, y + i as u16, "…", style); } + // TODO: print out symlink path // } else if file_type.is_symlink() { } else { if name_width < area_width - FILE_SIZE_WIDTH { diff --git a/src/ui/widgets/tui_view.rs b/src/ui/widgets/tui_view.rs index 72ff38c..cc6e1b2 100644 --- a/src/ui/widgets/tui_view.rs +++ b/src/ui/widgets/tui_view.rs @@ -105,12 +105,12 @@ impl<'a> Widget for TuiView<'a> { if self.show_bottom_status { /* draw the bottom status bar */ - if let Some(msg) = self.context.worker_msg.as_ref() { - let text = [Text::styled(msg, message_style)]; + if !self.context.message_queue.is_empty() { + let text = [Text::styled(&self.context.message_queue[0], message_style)]; Paragraph::new(text.iter()).wrap(true).draw(rect, buf); - } else if !self.context.message_queue.is_empty() { - let text = [Text::styled(&self.context.message_queue[0], message_style)]; + } else if let Some(msg) = self.context.worker_msg.as_ref() { + let text = [Text::styled(msg, message_style)]; Paragraph::new(text.iter()).wrap(true).draw(rect, buf); } else if let Some(entry) = curr_list.get_curr_ref() { |