small fixes

- Don't debug print Timer events in src/bin.rs event loop; they're too
frequent and pollute the logs
- chain set_{fg,bg,..} method calls for &mut Cell
- remove unneeded u8 to u8 cast
master
Manos Pitsidianakis 2020-01-27 17:15:29 +02:00
parent 3c7328d901
commit b823969ae2
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
3 changed files with 22 additions and 15 deletions

View File

@ -290,7 +290,7 @@ fn run_app() -> Result<()> {
crossbeam::select! {
recv(receiver) -> r => {
match r {
Ok(ThreadEvent::Pulse) => {},
Ok(ThreadEvent::Pulse) | Ok(ThreadEvent::UIEvent(UIEvent::Timer(_))) => {},
_ => {debug!(&r);}
}
match r.unwrap() {

View File

@ -748,19 +748,21 @@ impl ConversationsListing {
);
self.content[(x, 3 * idx)].set_bg(color);
if _x < width {
self.content[(_x, 3 * idx)].set_bg(color);
self.content[(_x, 3 * idx)].set_keep_bg(true);
self.content[(_x, 3 * idx)].set_bg(color).set_keep_bg(true);
}
for x in (x + 1).._x {
self.content[(x, 3 * idx)].set_keep_fg(true);
self.content[(x, 3 * idx)].set_keep_bg(true);
self.content[(x, 3 * idx)]
.set_keep_fg(true)
.set_keep_bg(true);
}
self.content[(x, 3 * idx)].set_keep_bg(true);
x = _x + 1;
}
for x in x..width {
self.content[(x, 3 * idx)].set_ch(' ');
self.content[(x, 3 * idx)].set_bg(bg_color);
self.content[(x, 3 * idx)]
.set_ch(' ')
.set_fg(fg_color)
.set_bg(bg_color);
}
/* Next line, draw date */
let (x, _) = write_string_to_grid(
@ -773,8 +775,10 @@ impl ConversationsListing {
None,
);
for x in x..(x + 4) {
self.content[(x, 3 * idx + 1)].set_ch('▁');
self.content[(x, 3 * idx + 1)].set_bg(bg_color);
self.content[(x, 3 * idx + 1)]
.set_ch('▁')
.set_fg(fg_color)
.set_bg(bg_color);
}
/* draw from */
let (x, _) = write_string_to_grid(
@ -788,13 +792,16 @@ impl ConversationsListing {
);
for x in x..width {
self.content[(x, 3 * idx + 1)].set_ch('▁');
self.content[(x, 3 * idx + 1)].set_bg(bg_color);
self.content[(x, 3 * idx + 1)]
.set_ch('▁')
.set_fg(fg_color)
.set_bg(bg_color);
}
for x in 0..width {
self.content[(x, 3 * idx + 2)].set_ch('▓');
self.content[(x, 3 * idx + 2)].set_fg(padding_fg);
self.content[(x, 3 * idx + 2)].set_bg(bg_color);
self.content[(x, 3 * idx + 2)]
.set_ch('▓')
.set_fg(padding_fg)
.set_bg(bg_color);
}
}
if self.length == 0 && self.filter_term.is_empty() {

View File

@ -740,7 +740,7 @@ impl Color {
| b @ Color::Cyan
| b @ Color::White
| b @ Color::Default => AnsiValue(b.as_byte()),
Color::Byte(b) => AnsiValue(b as u8),
Color::Byte(b) => AnsiValue(b),
Color::Rgb(_, _, _) => AnsiValue(0),
}
}