mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
collect hashes and file types
This commit is contained in:
parent
01bc1b7b47
commit
747abab922
5 changed files with 183 additions and 31 deletions
|
|
@ -2,7 +2,6 @@ use crate::*;
|
|||
use tek_tui::ratatui::{style::{Color, Style}, prelude::Stylize};
|
||||
use pad::PadStr;
|
||||
|
||||
|
||||
fn table_row (label: &str, artist: &str, album: &str, track: &str, title: &str) -> String {
|
||||
let label = label.pad_to_width(COLUMN_WIDTHS[0] as usize);
|
||||
let artist = artist.pad_to_width(COLUMN_WIDTHS[1] as usize);
|
||||
|
|
@ -11,6 +10,7 @@ fn table_row (label: &str, artist: &str, album: &str, track: &str, title: &str)
|
|||
let title = title.pad_to_width(COLUMN_WIDTHS[4] as usize);
|
||||
format!("{label}│{artist}╎{album}╎{track}╎{title}")
|
||||
}
|
||||
|
||||
fn status_bar (content: impl Content<TuiOut>) -> impl Content<TuiOut> {
|
||||
Fixed::y(1, Fill::x(Tui::bold(true, Tui::fg_bg(Color::Rgb(0,0,0), Color::Rgb(255,255,255), content))))
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ impl<'a> Content<TuiOut> for TreeTable<'a> {
|
|||
for (index, fragment) in entry.path.iter().enumerate() {
|
||||
if index == entry.depth - 1 {
|
||||
let cursor = if selected { ">" } else { " " };
|
||||
let icon = if entry.is_dir {"+"} else {" "};
|
||||
let icon = if entry.is_dir {"+"} else if entry.is_img {"I"} else if entry.is_mus {"M"} else {" "};
|
||||
let name = fragment.display();
|
||||
let indent = "".pad_to_width((entry.depth - 1) * 2);
|
||||
let label = table_row(&format!("{cursor} {indent}{icon} {name}"), "", "", "", "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue