diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-04-09 12:23:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 12:23:36 -0400 |
commit | 3ffd6e6501dd02ca991d16f1e2a140fa4d9d7118 (patch) | |
tree | 959fea2ec2b18ae87cff109d0d27f84f69d0713b /src/ui | |
parent | 14eefd238fe297dc1113a924afc0f6563f416b77 (diff) |
fix regular file styling not respecting theme config (#163)
- fix color not applying to entire row
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/widgets/tui_dirlist.rs | 7 | ||||
-rw-r--r-- | src/ui/widgets/tui_dirlist_detailed.rs | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/ui/widgets/tui_dirlist.rs b/src/ui/widgets/tui_dirlist.rs index 946834b..cffd8e3 100644 --- a/src/ui/widgets/tui_dirlist.rs +++ b/src/ui/widgets/tui_dirlist.rs @@ -37,6 +37,8 @@ impl<'a> Widget for TuiDirList<'a> { let drawing_width = area.width as usize; + let space_fill = " ".repeat(drawing_width); + self.dirlist .iter() .skip(skip_dist) @@ -51,10 +53,7 @@ impl<'a> Widget for TuiDirList<'a> { style::entry_style(entry) }; - if ix == curr_index { - let space_fill = " ".repeat(drawing_width); - buf.set_string(x, y + i as u16, space_fill.as_str(), style); - } + buf.set_string(x, y + i as u16, space_fill.as_str(), style); print_entry(buf, entry, style, (x + 1, y + i as u16), drawing_width - 1); }); diff --git a/src/ui/widgets/tui_dirlist_detailed.rs b/src/ui/widgets/tui_dirlist_detailed.rs index f5d07be..5705448 100644 --- a/src/ui/widgets/tui_dirlist_detailed.rs +++ b/src/ui/widgets/tui_dirlist_detailed.rs @@ -56,6 +56,8 @@ impl<'a> Widget for TuiDirListDetailed<'a> { .to_string() .len(); + let space_fill = " ".repeat(drawing_width); + // draw every entry self.dirlist .iter() @@ -71,6 +73,8 @@ impl<'a> Widget for TuiDirListDetailed<'a> { style::entry_style(entry) }; + buf.set_string(x, y + i as u16, space_fill.as_str(), style); + let line_number_string = if ix == curr_index { match line_num_style { LineNumberStyle::None => "".to_string(), @@ -90,11 +94,6 @@ impl<'a> Widget for TuiDirListDetailed<'a> { } }; - if ix == curr_index { - let space_fill = " ".repeat(drawing_width); - buf.set_string(x, y + i as u16, space_fill.as_str(), style); - } - print_entry( buf, entry, |