1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-25 04:25:42 +00:00
Roman Zeyde 2025-02-10 12:40:05 +02:00 committed by Roman Zeyde
parent ffc4b57e70
commit 0abfc7b1f9
3 changed files with 24 additions and 6 deletions

View File

@ -139,11 +139,17 @@ impl Loader {
}
pub fn is_completely_grown(&self, now: Instant) -> bool {
matches!(self.progress(now), Some(display::LOADER_MAX))
match &self.state {
State::Growing(a) => a.finished(now),
_ => false,
}
}
pub fn is_completely_shrunk(&self, now: Instant) -> bool {
matches!(self.progress(now), Some(display::LOADER_MIN))
match &self.state {
State::Shrinking(a) => a.finished(now),
_ => false,
}
}
}

View File

@ -154,11 +154,17 @@ impl Loader {
}
pub fn is_completely_grown(&self, now: Instant) -> bool {
matches!(self.progress(now), Some(display::LOADER_MAX))
match &self.state {
State::Growing(a) => a.finished(now),
_ => false,
}
}
pub fn is_completely_shrunk(&self, now: Instant) -> bool {
matches!(self.progress(now), Some(display::LOADER_MIN))
match &self.state {
State::Shrinking(a) => a.finished(now),
_ => false,
}
}
pub fn render_loader<'s>(

View File

@ -143,11 +143,17 @@ impl Loader {
}
pub fn is_completely_grown(&self, now: Instant) -> bool {
matches!(self.progress_raw(now), Some(display::LOADER_MAX))
match &self.state {
State::Growing(a) => a.finished(now),
_ => false,
}
}
pub fn is_completely_shrunk(&self, now: Instant) -> bool {
matches!(self.progress_raw(now), Some(display::LOADER_MIN))
match &self.state {
State::Shrinking(a) => a.finished(now),
_ => false,
}
}
}