Redraw after clock.toggle().

This commit is contained in:
shy 2021-04-12 21:45:45 +02:00
parent 1b76c98ea6
commit bef717e663
2 changed files with 7 additions and 4 deletions

View file

@ -158,8 +158,8 @@ impl AlarmRoster {
}
// Check for active alarms.
pub fn active(&self) -> bool {
self.list.iter().any(|a| !a.exceeded)
pub fn idle(&self) -> bool {
!self.list.iter().any(|a| !a.exceeded)
}
// Check for exceeded alarms.

View file

@ -77,7 +77,10 @@ pub fn run(
layout.force_redraw = true;
},
// (Un-)Pause clock on SIGUSR2.
SIGUSR2 => clock.toggle(),
SIGUSR2 => {
clock.toggle();
layout.force_redraw = true;
},
// We didn't register anything else.
_ => unreachable!(),
}
@ -126,7 +129,7 @@ pub fn run(
}
}
// Quit if configured.
if config.quit && !alarm_roster.active() {
if config.quit && alarm_roster.idle() {
break;
}
}