aboutsummaryrefslogtreecommitdiff
path: root/src/tui
diff options
context:
space:
mode:
authorlukeflo2025-06-30 21:49:53 +0200
committerlukeflo2025-06-30 21:49:53 +0200
commit9bd2f6fef0d835ffb97e18993161e6639c98d2d1 (patch)
tree1ff5038fbeda1fe8ee9643a1611b3009345779f5 /src/tui
parent3a40bbb367a79dc3660c12aa7f62e3efc378ea22 (diff)
downloadbibiman-9bd2f6fef0d835ffb97e18993161e6639c98d2d1.tar.gz
bibiman-9bd2f6fef0d835ffb97e18993161e6639c98d2d1.zip
align resource symbols, update README
Diffstat (limited to 'src/tui')
-rw-r--r--src/tui/ui.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/tui/ui.rs b/src/tui/ui.rs
index 3c83935..be53f61 100644
--- a/src/tui/ui.rs
+++ b/src/tui/ui.rs
@@ -300,7 +300,7 @@ pub fn render_popup(app: &mut App, cfg: &BibiConfig, frame: &mut Frame) {
};
let bottom_info = if let Some(PopupKind::OpenRes) = app.bibiman.popup_area.popup_kind {
- " (j,k|↓,↑) ━ (o,l) ━ (ENTER) ━ (ESC) ".bold()
+ " (j,k|↓,↑) ━ (o,l,n) ━ (ENTER) ━ (ESC) ".bold()
} else if let Some(PopupKind::YankItem) = app.bibiman.popup_area.popup_kind {
" (j,k|↓,↑) ━ (y) ━ (ENTER) ━ (ESC) ".bold()
} else {
@@ -580,7 +580,7 @@ pub fn render_entrytable(app: &mut App, cfg: &BibiConfig, frame: &mut Frame, rec
.bg(cfg.colors.bar_bg_color);
let header = Row::new(vec![
- Cell::from(Line::from("")).bg(cfg.colors.bar_bg_color),
+ Cell::from(Line::from("Res.")).bg(cfg.colors.bar_bg_color),
Cell::from(
Line::from(vec![{ Span::raw("Author") }, {
if let Some(EntryTableColumn::Authors) =
@@ -703,23 +703,38 @@ pub fn render_entrytable(app: &mut App, cfg: &BibiConfig, frame: &mut Frame, rec
let mut symbol_vec = vec![];
+ // use default or custom symbols for resources
+ // if an entry has no, replace it with the correct number
+ // of whitespace to align the symbols correct
if let Some(f) = &item.symbols[0] {
symbol_vec.push(Span::styled(
f,
Style::new().fg(cfg.colors.file_color).bold(),
));
+ } else {
+ symbol_vec.push(Span::raw(
+ " ".repeat(cfg.general.file_symbol.chars().count()),
+ ));
}
if let Some(l) = &item.symbols[1] {
symbol_vec.push(Span::styled(
l,
Style::new().fg(cfg.colors.link_color).bold(),
));
+ } else {
+ symbol_vec.push(Span::raw(
+ " ".repeat(cfg.general.link_symbol.chars().count()),
+ ));
}
if let Some(n) = &item.symbols[2] {
symbol_vec.push(Span::styled(
n,
Style::new().fg(cfg.colors.note_color).bold(),
))
+ } else {
+ symbol_vec.push(Span::raw(
+ " ".repeat(cfg.general.note_symbol.chars().count()),
+ ));
}
let row = Row::new(vec![