diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/widgets/tui_dirlist.rs | 6 | ||||
-rw-r--r-- | src/ui/widgets/tui_dirlist_detailed.rs | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ui/widgets/tui_dirlist.rs b/src/ui/widgets/tui_dirlist.rs index 60b7374..afa3258 100644 --- a/src/ui/widgets/tui_dirlist.rs +++ b/src/ui/widgets/tui_dirlist.rs @@ -40,6 +40,8 @@ impl<'a> Widget for TuiDirList<'a> { let screen_index = curr_index % area.height as usize; let area_width = area.width as usize - 1; + let space_fill = " ".repeat(area_width); + for (i, entry) in self .dirlist .iter() @@ -51,7 +53,9 @@ impl<'a> Widget for TuiDirList<'a> { let name_width = name.width(); let style = if i == screen_index { - entry.get_style().add_modifier(Modifier::REVERSED) + let s = entry.get_style().add_modifier(Modifier::REVERSED); + buf.set_string(x, y + i as u16, space_fill.as_str(), s); + s } else { entry.get_style() }; diff --git a/src/ui/widgets/tui_dirlist_detailed.rs b/src/ui/widgets/tui_dirlist_detailed.rs index 4bb63ce..b63ebdb 100644 --- a/src/ui/widgets/tui_dirlist_detailed.rs +++ b/src/ui/widgets/tui_dirlist_detailed.rs @@ -1,6 +1,7 @@ use tui::buffer::Buffer; use tui::layout::Rect; use tui::style::{Color, Modifier, Style}; +use tui::symbols::block; use tui::widgets::Widget; use unicode_width::UnicodeWidthStr; @@ -42,6 +43,8 @@ impl<'a> Widget for TuiDirListDetailed<'a> { let screen_index = curr_index % area.height as usize; let area_width = area.width as usize; + let space_fill = " ".repeat(area_width); + for (i, entry) in self .dirlist .iter() @@ -58,6 +61,8 @@ impl<'a> Widget for TuiDirListDetailed<'a> { entry.get_style() }; + buf.set_string(x, y + i as u16, space_fill.as_str(), style); + let file_type = &entry.metadata.file_type; match file_type { FileType::Directory => { |