Added painting to icon

This commit is contained in:
Alex Soderman 2018-03-25 12:11:47 -04:00
parent 694c4417a0
commit d962889134

View File

@ -40,11 +40,14 @@ impl<'a> Render<'a> {
for file in self.files.iter() {
let file_icon = icon(&file);
let painted_icon = self.style.exts
.colour_file(&file)
.map_or(file_icon.to_string(), |c| { c.paint(format!("{}", file_icon)).to_string() });
let filename = self.style.for_file(file, self.colours).paint();
let width = DisplayWidth::from(2) + filename.width();
grid.add(tg::Cell {
contents: format!("{} {}", file_icon, filename.strings().to_string()),
contents: format!("{} {}", painted_icon, filename.strings().to_string()),
width: *width,
});
}