Fix missing slicing progress on the first slice (#16000)

Restore slicing progress after notification reset

Ensure the cleared slicing-progress controller is recreated before its initial state transition, and calculate the Daily Tips size before positioning the popup.
This commit is contained in:
Kiss Lorand
2026-10-04 14:06:23 +03:00
committed by GitHub
parent 90ac58d3cd
commit 5efb3bef45
3 changed files with 24 additions and 15 deletions
+14 -7
View File
@@ -2880,17 +2880,24 @@ void NotificationManager::update_slicing_notif_dailytips(bool need_change)
// Slicing progress notification was not found - init it thru plater so correct cancel callback function is appended
wxGetApp().plater()->init_notification_manager();
}
// Orca: Ensures the slicing-progress controller exists before applying the first slicing transition.
void NotificationManager::set_slicing_progress_began()
{
for (std::unique_ptr<PopNotification> & notification : m_pop_notifications) {
if (notification->get_type() == NotificationType::SlicingProgress) {
SlicingProgressNotification* spn = dynamic_cast<SlicingProgressNotification*>(notification.get());
spn->set_progress_state(SlicingProgressNotification::SlicingProgressState::SP_BEGAN);
return;
auto find_slicing_progress = [this]() -> SlicingProgressNotification* {
for (std::unique_ptr<PopNotification>& notification : m_pop_notifications) {
if (notification->get_type() == NotificationType::SlicingProgress)
return dynamic_cast<SlicingProgressNotification*>(notification.get());
}
return nullptr;
};
SlicingProgressNotification* notification = find_slicing_progress();
if (notification == nullptr) {
wxGetApp().plater()->init_notification_manager();
notification = find_slicing_progress();
}
// Slicing progress notification was not found - init it thru plater so correct cancel callback function is appended
wxGetApp().plater()->init_notification_manager();
if (notification != nullptr)
notification->set_progress_state(SlicingProgressNotification::SlicingProgressState::SP_BEGAN);
}
void NotificationManager::set_slicing_progress_percentage(const std::string& text, float percentage)
{