mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-11 02:29:37 +03:00
feat(ui): disabled fraction displaying in repairer's progress bar
This commit is contained in:
parent
3d6b3bfd96
commit
985b66d72b
2 changed files with 5 additions and 0 deletions
src/ui
|
@ -39,6 +39,8 @@ pub struct ProgressBar {
|
|||
pub enum ProgressBarMsg {
|
||||
Reset,
|
||||
UpdateCaption(Option<String>),
|
||||
DisplayProgress(bool),
|
||||
DisplayFraction(bool),
|
||||
|
||||
/// (current bytes, total bytes)
|
||||
UpdateProgress(u64, u64),
|
||||
|
@ -115,6 +117,8 @@ impl SimpleAsyncComponent for ProgressBar {
|
|||
}
|
||||
|
||||
ProgressBarMsg::UpdateCaption(caption) => self.caption = caption,
|
||||
ProgressBarMsg::DisplayProgress(value) => self.display_progress = value,
|
||||
ProgressBarMsg::DisplayFraction(value) => self.display_fraction = value,
|
||||
|
||||
ProgressBarMsg::UpdateProgress(curr, total) => {
|
||||
self.fraction = curr as f64 / total as f64;
|
||||
|
|
|
@ -100,6 +100,7 @@ pub fn repair_game(sender: ComponentSender<App>, progress_bar_input: Sender<Prog
|
|||
|
||||
if !broken.is_empty() {
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateCaption(Some(tr("repairing-files"))));
|
||||
progress_bar_input.send(ProgressBarMsg::DisplayFraction(false));
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateProgress(0, 0));
|
||||
|
||||
tracing::warn!("Found broken files:\n{}", broken.iter().fold(String::new(), |acc, file| acc + &format!("- {}\n", file.path.to_string_lossy())));
|
||||
|
|
Loading…
Add table
Reference in a new issue