diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index de58209e43..123c7dcc4e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -13,6 +13,7 @@ #include "slic3r/GUI/Jobs/NotificationProgressIndicator.hpp" #include "slic3r/Utils/WxFontUtils.hpp" #include "slic3r/Utils/FontListSerializable.hpp" +#include "slic3r/Utils/UndoRedo.hpp" // TODO: remove include #include "libslic3r/SVG.hpp" // debug store @@ -979,7 +980,7 @@ void GLGizmoEmboss::draw_model_type() if (m_volume != nullptr && new_type.has_value() && !is_last_solid_part) { GUI_App &app = wxGetApp(); Plater * plater = app.plater(); - plater->take_snapshot(_L("Change Part Type")); + Plater::TakeSnapshot snapshot(plater, _L("Change Part Type"), UndoRedo::SnapshotType::GizmoAction); m_volume->set_type(*new_type); // inspiration in ObjectList::change_part_type() diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp index c89bef345d..900e205233 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp @@ -72,10 +72,10 @@ protected: void on_start_dragging() override; void on_stop_dragging() override; - //bool wants_enter_leave_snapshots() const override { return true; } - //std::string get_gizmo_entering_text() const override { return _u8L("Enter emboss gizmo"); } - //std::string get_gizmo_leaving_text() const override { return _u8L("Leave emboss gizmo"); } - //std::string get_action_snapshot_name() override { return _u8L("Emboss action"); } + bool wants_enter_leave_snapshots() const override { return true; } + std::string get_gizmo_entering_text() const override { return _u8L("Enter emboss gizmo"); } + std::string get_gizmo_leaving_text() const override { return _u8L("Leave emboss gizmo"); } + std::string get_action_snapshot_name() override { return _u8L("Embossing actions"); } private: void initialize(); static FontList create_default_font_list(); diff --git a/src/slic3r/GUI/Jobs/EmbossJob.cpp b/src/slic3r/GUI/Jobs/EmbossJob.cpp index 26b3c2bf63..a8f9a57b15 100644 --- a/src/slic3r/GUI/Jobs/EmbossJob.cpp +++ b/src/slic3r/GUI/Jobs/EmbossJob.cpp @@ -13,6 +13,7 @@ #include "slic3r/GUI/GUI_ObjectManipulation.hpp" #include "slic3r/GUI/Gizmos/GLGizmoEmboss.hpp" #include "slic3r/GUI/CameraUtils.hpp" +#include "slic3r/Utils/UndoRedo.hpp" using namespace Slic3r; using namespace GUI; @@ -49,7 +50,10 @@ void EmbossUpdateJob::finalize(bool canceled, std::exception_ptr &) // Check emboss gizmo is still open if (manager.get_current_type() != GLGizmosManager::Emboss) return; - plater->take_snapshot(_L("Emboss text") + ": " + m_input->volume_name); + Plater::TakeSnapshot snapshot(plater, + GUI::format(_L("Text: %1%"), + m_input->text_configuration.text), + UndoRedo::SnapshotType::GizmoAction); ModelVolume *volume = m_input->volume; // find volume by object id - NOT WORK @@ -162,7 +166,7 @@ void EmbossCreateJob::finalize(bool canceled, std::exception_ptr &) // decide if create object or volume bool create_object = !m_input->object_idx.has_value(); if (create_object) { - plater->take_snapshot(_L("Add Emboss text object")); + Plater::TakeSnapshot snapshot(plater, _L("Add Emboss text object")); // Create new object and change selection bool center = false; obj_list->load_mesh_object(std::move(m_result), m_input->volume_name, center,