diff --git a/src/gui/app.rs b/src/gui/app.rs index b8ed59f..d88b393 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -60,13 +60,13 @@ impl App { ModalId::Exit => { if self.show_exit_progress { if !Node::is_running() { + modal.close(); Self::exit(frame, cb); - } else { - ui.add_space(10.0); - let text = Node::get_sync_status_text(Node::get_sync_status()); - ProgressLoading::new(text).ui(ui); - ui.add_space(10.0); } + ui.add_space(12.0); + let text = Node::get_sync_status_text(Node::get_sync_status()); + ProgressLoading::new(text).ui(ui); + ui.add_space(12.0); } else { ui.add_space(8.0); ui.vertical_centered(|ui| { diff --git a/src/gui/views/modal.rs b/src/gui/views/modal.rs index 7e1faa9..852ccc0 100644 --- a/src/gui/views/modal.rs +++ b/src/gui/views/modal.rs @@ -215,14 +215,14 @@ impl Modal { let bg_idx = ui.painter().add(bg_shape); // Draw main content. - let mut content_resp_rect = ui.allocate_ui_at_rect(rect, |ui| { + let mut content_rect = ui.allocate_ui_at_rect(rect, |ui| { (add_content)(ui, frame, self); }).response.rect; // Setup background shape to be painted behind main content. - content_resp_rect.min -= egui::emath::vec2(6.0, 0.0); - content_resp_rect.max += egui::emath::vec2(6.0, 0.0); - bg_shape.rect = content_resp_rect; + content_rect.min -= egui::emath::vec2(6.0, 0.0); + content_rect.max += egui::emath::vec2(6.0, 0.0); + bg_shape.rect = content_rect; ui.painter().set(bg_idx, bg_shape); } diff --git a/src/gui/views/progress_loading.rs b/src/gui/views/progress_loading.rs index caf1bbf..b8362fd 100644 --- a/src/gui/views/progress_loading.rs +++ b/src/gui/views/progress_loading.rs @@ -31,6 +31,7 @@ impl ProgressLoading { impl Widget for ProgressLoading { fn ui(self, ui: &mut Ui) -> Response { ui.vertical_centered_justified(|ui| { + ui.add_space(10.0); Spinner::new().size(36.0).color(COLOR_DARK).ui(ui); ui.add_space(10.0); ui.label(RichText::new(self.text).size(18.0).color(COLOR_DARK));