mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Trigger task progress update on paint event as well (#3237)
This commit is contained in:
@@ -118,26 +118,20 @@ class PlaterWorker: public Worker {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void on_idle(wxIdleEvent &evt)
|
EventGuard on_idle_evt;
|
||||||
{
|
EventGuard on_paint_evt;
|
||||||
process_events();
|
|
||||||
evt.Skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<class... WorkerArgs>
|
template<class... WorkerArgs>
|
||||||
PlaterWorker(wxWindow *plater, WorkerArgs &&...args)
|
PlaterWorker(wxWindow *plater, WorkerArgs &&...args)
|
||||||
: m_w{std::forward<WorkerArgs>(args)...}, m_plater{plater}
|
: m_w{std::forward<WorkerArgs>(args)...}
|
||||||
{
|
, m_plater{plater}
|
||||||
// Ensure that messages from the worker thread to the UI thread are
|
// Ensure that messages from the worker thread to the UI thread are
|
||||||
// processed continuously.
|
// processed continuously.
|
||||||
plater->Bind(wxEVT_IDLE, &PlaterWorker::on_idle, this);
|
, on_idle_evt(plater, wxEVT_IDLE, [this](wxIdleEvent&) { process_events(); })
|
||||||
}
|
, on_paint_evt(plater, wxEVT_PAINT, [this](wxPaintEvent&) { process_events(); })
|
||||||
|
|
||||||
~PlaterWorker()
|
|
||||||
{
|
{
|
||||||
m_plater->Unbind(wxEVT_IDLE, &PlaterWorker::on_idle, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always package the job argument into a PlaterJob
|
// Always package the job argument into a PlaterJob
|
||||||
|
|||||||
Reference in New Issue
Block a user