generated from PlexSheep/rs-base
Compare commits
2 commits
d62fd468ff
...
27d135b1c8
Author | SHA1 | Date | |
---|---|---|---|
27d135b1c8 | |||
6863448974 |
1 changed files with 10 additions and 5 deletions
15
src/clock.rs
15
src/clock.rs
|
@ -374,6 +374,12 @@ impl Clock {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_sign_loss)]
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
let padding = [
|
||||
(f32::from(parts[2].width) * 0.43) as u16,
|
||||
(f32::from(parts[2].width) * 0.25) as u16,
|
||||
];
|
||||
let timebarw = LineGauge::default()
|
||||
.filled_style(if self.did_notify {
|
||||
Style::default()
|
||||
|
@ -387,9 +393,9 @@ impl Clock {
|
|||
})
|
||||
.unfilled_style(Style::default())
|
||||
.block(Block::default().padding(Padding::right(if a.width > 80 {
|
||||
(f32::from(parts[2].width) * 0.43) as u16
|
||||
padding[0]
|
||||
} else {
|
||||
(f32::from(parts[2].width) * 0.25) as u16
|
||||
padding[1]
|
||||
})))
|
||||
.ratio(ratio);
|
||||
Some(timebarw)
|
||||
|
@ -446,9 +452,6 @@ impl Clock {
|
|||
// NOTE: sadly, notify_rust does not (yet) support KDE plasma, because
|
||||
// they have a weird way of making sounds and notifications in general
|
||||
// work. At least we get a little notification.
|
||||
//
|
||||
// TODO: add something to make a sound without the notification system,
|
||||
// as that is not reliable but the user might depend on it.
|
||||
|
||||
// only play this when we don't use built in sound, this
|
||||
// isn't as consistent
|
||||
|
@ -490,6 +493,8 @@ impl Clock {
|
|||
Constraint::Length(if r.width > 80 { 8 } else { 5 }),
|
||||
])
|
||||
.split(r);
|
||||
#[allow(clippy::cast_sign_loss)]
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
let hlen_date: u16 = (f32::from(part[1].width) * 0.35) as u16;
|
||||
let subparts = Layout::default()
|
||||
.direction(Direction::Horizontal)
|
||||
|
|
Reference in a new issue