From b0862a0eef899c2d7d8ed47d1019071735f958d2 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 10 Jul 2024 01:39:05 +0200 Subject: [PATCH] refactor: style timebar and fix custom resets --- src/clock.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/clock.rs b/src/clock.rs index 8a38c49..c949329 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -4,6 +4,7 @@ use chrono::{DateTime, Datelike, Local, NaiveDateTime, SubsecRound, Timelike}; use clap::Parser; use libpt::cli::args::HELP_TEMPLATE; +use libpt::cli::clap::builder::styling::Color; use libpt::cli::clap::ArgGroup; use libpt::cli::{args::VerbosityLevel, clap}; use libpt::log::{debug, trace}; @@ -99,7 +100,7 @@ impl Clock { if Local::now() .signed_duration_since(self.last_reset.unwrap()) .num_seconds() - == 0 + >= len.as_secs() { self.last_reset = Some(Local::now()); } @@ -245,6 +246,8 @@ impl Clock { frame.render_widget(datew, parts[1]); if self.timebar_len().is_some() { let timebarw = LineGauge::default() + .filled_style(Style::default().blue()) + .unfilled_style(Style::default()) .block(Block::new().padding(Padding::new( parts[2].left() / 10, parts[2].right() / 6,