Merge branch 'dk_notifications'
This commit is contained in:
commit
4d5500f10c
3 changed files with 6 additions and 6 deletions
|
@ -646,7 +646,6 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
||||||
if (m_layers_slider->IsNewPrint())
|
if (m_layers_slider->IsNewPrint())
|
||||||
{
|
{
|
||||||
NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager();
|
NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager();
|
||||||
// notif_mngr->close_notification_of_type(NotificationType::SignDetected);
|
|
||||||
|
|
||||||
const Print& print = wxGetApp().plater()->fff_print();
|
const Print& print = wxGetApp().plater()->fff_print();
|
||||||
double delta_area = scale_(scale_(25)); // equal to 25 mm2
|
double delta_area = scale_(scale_(25)); // equal to 25 mm2
|
||||||
|
@ -676,13 +675,12 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
||||||
NotificationType::SignDetected, NotificationManager::NotificationLevel::RegularNotification,
|
NotificationType::SignDetected, NotificationManager::NotificationLevel::RegularNotification,
|
||||||
_u8L("NOTE:") + "\n" + _u8L("Sliced object looks like the sign") + "\n",
|
_u8L("NOTE:") + "\n" + _u8L("Sliced object looks like the sign") + "\n",
|
||||||
_u8L("Apply auto color change to print"),
|
_u8L("Apply auto color change to print"),
|
||||||
[this, notif_mngr](wxEvtHandler*) {
|
[this](wxEvtHandler*) {
|
||||||
notif_mngr->close_notification_of_type(NotificationType::SignDetected);
|
|
||||||
m_layers_slider->auto_color_change();
|
m_layers_slider->auto_color_change();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
notif_mngr->set_in_preview(true);
|
notif_mngr->apply_in_preview();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1014,7 +1014,7 @@ void NotificationManager::push_plater_warning_notification(const std::string& te
|
||||||
auto notification = std::make_unique<NotificationManager::PlaterWarningNotification>(data, m_id_provider, m_evt_handler);
|
auto notification = std::make_unique<NotificationManager::PlaterWarningNotification>(data, m_id_provider, m_evt_handler);
|
||||||
push_notification_data(std::move(notification), 0);
|
push_notification_data(std::move(notification), 0);
|
||||||
// dissaper if in preview
|
// dissaper if in preview
|
||||||
set_in_preview(m_in_preview);
|
apply_in_preview();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationManager::close_plater_warning_notification(const std::string& text)
|
void NotificationManager::close_plater_warning_notification(const std::string& text)
|
||||||
|
|
|
@ -159,8 +159,10 @@ public:
|
||||||
void render_notifications(GLCanvas3D& canvas, float overlay_width);
|
void render_notifications(GLCanvas3D& canvas, float overlay_width);
|
||||||
// finds and closes all notifications of given type
|
// finds and closes all notifications of given type
|
||||||
void close_notification_of_type(const NotificationType type);
|
void close_notification_of_type(const NotificationType type);
|
||||||
// Which view is active? Plater or G-code preview? Hide warnings in G-code preview.
|
// Hides warnings in G-code preview. Should be called from plater only when 3d view/ preview is changed
|
||||||
void set_in_preview(bool preview);
|
void set_in_preview(bool preview);
|
||||||
|
// Calls set_in_preview to apply appearing or disappearing of some notificatons;
|
||||||
|
void apply_in_preview() { set_in_preview(m_in_preview); }
|
||||||
// Move to left to avoid colision with variable layer height gizmo.
|
// Move to left to avoid colision with variable layer height gizmo.
|
||||||
void set_move_from_overlay(bool move) { m_move_from_overlay = move; }
|
void set_move_from_overlay(bool move) { m_move_from_overlay = move; }
|
||||||
// perform update_state on each notification and ask for more frames if needed, return true for render needed
|
// perform update_state on each notification and ask for more frames if needed, return true for render needed
|
||||||
|
|
Loading…
Reference in a new issue