mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Fix spacing at column end and for first column
This commit is contained in:
parent
bbfba5a5e7
commit
a5b526cf3f
2 changed files with 6 additions and 4 deletions
|
@ -436,7 +436,7 @@ impl TTApp {
|
|||
|
||||
let (contexts, headers) = self.get_all_contexts();
|
||||
|
||||
let maximum_column_width = area.width - 2;
|
||||
let maximum_column_width = area.width;
|
||||
let widths = self.calculate_widths(&contexts, &headers, maximum_column_width);
|
||||
|
||||
let selected = self.context_table_state.selected().unwrap_or_default();
|
||||
|
@ -618,7 +618,7 @@ impl TTApp {
|
|||
return;
|
||||
}
|
||||
|
||||
let maximum_column_width = rect.width - 2;
|
||||
let maximum_column_width = rect.width;
|
||||
let widths = self.calculate_widths(&tasks, &headers, maximum_column_width);
|
||||
|
||||
for (i, header) in headers.iter().enumerate() {
|
||||
|
|
|
@ -274,14 +274,18 @@ where
|
|||
let mut x = table_area.left();
|
||||
|
||||
// Draw header
|
||||
let mut header_index = usize::MAX;
|
||||
let mut index = 0;
|
||||
if y < table_area.bottom() {
|
||||
for (w, t) in solved_widths.iter().zip(self.header.by_ref()) {
|
||||
if t.to_string() == "ID" {
|
||||
buf.set_stringn(x, y, format!("{symbol:>width$}", symbol=t, width=*w as usize), *w as usize, self.header_style);
|
||||
header_index = index;
|
||||
} else {
|
||||
buf.set_stringn(x, y, format!("{}", t), *w as usize, self.header_style);
|
||||
}
|
||||
x += *w + self.column_spacing;
|
||||
index += 1;
|
||||
}
|
||||
}
|
||||
y += 1 + self.header_gap;
|
||||
|
@ -294,8 +298,6 @@ where
|
|||
let highlight_symbol = self.highlight_symbol.unwrap_or("");
|
||||
let blank_symbol = iter::repeat(" ").take(highlight_symbol.width()).collect::<String>();
|
||||
|
||||
let header_index = self.header.by_ref().into_iter().position(|r| r.to_string() == "ID").unwrap_or_else(|| 0);
|
||||
|
||||
// Draw rows
|
||||
let default_style = Style::default();
|
||||
if y < table_area.bottom() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue