Add underline for header

This commit is contained in:
Dheepak Krishnamurthy 2021-02-08 11:47:23 -07:00
parent d416d1b94b
commit a4715ae352
2 changed files with 3 additions and 0 deletions

View file

@ -471,6 +471,7 @@ impl TTApp {
Span::styled("Context", Style::default().add_modifier(Modifier::BOLD)),
])),
)
.header_style(Style::default().add_modifier(Modifier::UNDERLINED))
.highlight_style(highlight_style)
.highlight_symbol(&self.config.uda_selection_indicator)
.widths(&constraints);
@ -673,6 +674,7 @@ impl TTApp {
Span::styled("Calendar", Style::default().add_modifier(Modifier::DIM)),
])),
)
.header_style(Style::default().add_modifier(Modifier::UNDERLINED))
.highlight_style(highlight_style)
.highlight_symbol(&self.config.uda_selection_indicator)
.widths(&constraints);

View file

@ -278,6 +278,7 @@ where
let mut index = 0;
if y < table_area.bottom() {
for (w, t) in solved_widths.iter().zip(self.header.by_ref()) {
buf.set_stringn(x, y, format!("{symbol:>width$}", symbol=" ", width=*w as usize), *w as usize, self.header_style);
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;