pub fn update_progress(ui: &mut egui::Ui, update_state: &DeviceUpdateState) {
    ui.group(|ui| {
        ui.set_width(ui.available_width());
        ui.set_height(ui.available_height());
        ui.set_enabled(update_state.preflight_checks_passed);

        ui.vertical(|ui| {
            egui::Grid::new("progress_bars")
                .num_columns(2)
                .spacing((20.0, 10.0))
                .show(ui, |ui| {
                    ui.label("Erase");
                    ui.add(
                        egui::ProgressBar::new(update_state.erase_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Erase),
                            ),
                    );
                    ui.end_row();

                    ui.label("Program");
                    ui.add(
                        egui::ProgressBar::new(update_state.program_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Program),
                            ),
                    );
                    ui.end_row();

                    ui.label("Verify");
                    ui.add(
                        egui::ProgressBar::new(update_state.verify_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Verify),
                            ),
                    );
                    ui.end_row();
                })
        });
    });
}
/// Show box with update progress bars
Show box with update progress bars
Show box with update progress bars
pub fn update_progress(ui: &mut egui::Ui, update_state: &DeviceUpdateState) {
    ui.group(|ui| {
        ui.set_width(ui.available_width());
        ui.set_height(ui.available_height());
        ui.set_enabled(update_state.preflight_checks_passed);
        ui.vertical(|ui| {
            egui::Grid::new("progress_bars")
                .num_columns(2)
                .spacing((20.0, 10.0))
                .show(ui, |ui| {
                    ui.label("Erase");
                    ui.add(
                        egui::ProgressBar::new(update_state.erase_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Erase),
                            ),
                    );
                    ui.end_row();
                    ui.label("Program");
                    ui.add(
                        egui::ProgressBar::new(update_state.program_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Program),
                            ),
                    );
                    ui.end_row();
                    ui.label("Verify");
                    ui.add(
                        egui::ProgressBar::new(update_state.verify_progress)
                            .show_percentage()
                            .animate(
                                update_state
                                    .step
                                    .as_ref()
                                    .map_or(false, |step| *step == DeviceUpdateStep::Verify),
                            ),
                    );
                    ui.end_row();
                })
        });
    });
}
pub fn update_progress ( ui : & mut egui :: Ui , update_state : & DeviceUpdateState ) { ui . group ( | ui | { ui . set_width ( ui . available_width ( ) ) ; ui . set_height ( ui . available_height ( ) ) ; ui . set_enabled ( update_state . preflight_checks_passed ) ; ui . vertical ( | ui | { egui :: Grid :: new ( " " ) . num_columns ( 2 ) . spacing ( ( 20.0 , 10.0 ) ) . show ( ui , | ui | { ui . label ( " " ) ; ui . add ( egui :: ProgressBar :: new ( update_state . erase_progress ) . show_percentage ( ) . animate ( update_state . step . as_ref ( ) . map_or ( false , | step | * step == DeviceUpdateStep :: Erase ) , ) , ) ; ui . end_row ( ) ; ui . label ( " " ) ; ui . add ( egui :: ProgressBar :: new ( update_state . program_progress ) . show_percentage ( ) . animate ( update_state . step . as_ref ( ) . map_or ( false , | step | * step == DeviceUpdateStep :: Program ) , ) , ) ; ui . end_row ( ) ; ui . label ( " " ) ; ui . add ( egui :: ProgressBar :: new ( update_state . verify_progress ) . show_percentage ( ) . animate ( update_state . step . as_ref ( ) . map_or ( false , | step | * step == DeviceUpdateStep :: Verify ) , ) , ) ; ui . end_row ( ) ; } ) } ) ; } ) ; }
Show box with update progress bars
Show box with update progress bars
ui
&mut egui::Ui
update_state
&DeviceUpdateState