mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-06 23:31:19 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user