mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Change calendar styling
This commit is contained in:
parent
32a8a79455
commit
08f97293cd
1 changed files with 14 additions and 4 deletions
|
@ -142,14 +142,24 @@ impl <'a> Widget for Calendar<'a> {
|
|||
}
|
||||
let d = &mut days[c];
|
||||
let m = d.0.month() as usize;
|
||||
let s = format!("{:^21}", month_names[m - 1]);
|
||||
buf.set_string(x, y, &s, Style::default());
|
||||
x += s.len() as u16;
|
||||
let s = format!("{:^20}", month_names[m - 1]);
|
||||
if m == today.month() as usize && self.year + year as i32 == today.year() {
|
||||
buf.set_string(x, y, &s, Style::default().add_modifier(Modifier::REVERSED));
|
||||
} else {
|
||||
buf.set_string(x, y, &s, Style::default().add_modifier(Modifier::DIM));
|
||||
}
|
||||
x += s.len() as u16 + 1;
|
||||
}
|
||||
y += 1;
|
||||
let mut x = area.x + startx;
|
||||
for c in startm..endm {
|
||||
buf.set_string(x as u16, y, "Su Mo Tu We Th Fr Sa", Style::default());
|
||||
let d = &mut days[c];
|
||||
let m = d.0.month() as usize;
|
||||
if m == today.month() as usize && self.year + year as i32 == today.year() {
|
||||
buf.set_string(x as u16, y, "Su Mo Tu We Th Fr Sa", Style::default().add_modifier(Modifier::REVERSED));
|
||||
} else {
|
||||
buf.set_string(x as u16, y, "Su Mo Tu We Th Fr Sa", Style::default().add_modifier(Modifier::DIM));
|
||||
}
|
||||
x += 21 + 1;
|
||||
}
|
||||
y += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue