This commit is contained in:
enricoturri1966 2021-08-30 10:47:09 +02:00
commit cc56769ec3
5 changed files with 14 additions and 8 deletions

View File

@ -19,6 +19,9 @@ protected:
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering Paint-on supports"); }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving Paint-on supports"); }
private: private:
bool on_init() override; bool on_init() override;

View File

@ -128,6 +128,9 @@ protected:
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering Multimaterial painting"); }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving Multimaterial painting"); }
size_t m_first_selected_extruder_idx = 0; size_t m_first_selected_extruder_idx = 0;
size_t m_second_selected_extruder_idx = 1; size_t m_second_selected_extruder_idx = 1;
std::vector<std::string> m_original_extruders_names; std::vector<std::string> m_original_extruders_names;

View File

@ -47,20 +47,14 @@ void GLGizmoPainterBase::activate_internal_undo_redo_stack(bool activate)
plater->undo_redo_topmost_string_getter(plater->can_undo(), last_snapshot_name); plater->undo_redo_topmost_string_getter(plater->can_undo(), last_snapshot_name);
if (activate && !m_internal_stack_active) { if (activate && !m_internal_stack_active) {
std::string str = get_painter_type() == PainterGizmoType::FDM_SUPPORTS if (std::string str = this->get_gizmo_entering_text(); last_snapshot_name != str)
? _u8L("Entering Paint-on supports")
: _u8L("Entering Seam painting");
if (last_snapshot_name != str)
Plater::TakeSnapshot(plater, str); Plater::TakeSnapshot(plater, str);
plater->enter_gizmos_stack(); plater->enter_gizmos_stack();
m_internal_stack_active = true; m_internal_stack_active = true;
} }
if (!activate && m_internal_stack_active) { if (!activate && m_internal_stack_active) {
plater->leave_gizmos_stack(); plater->leave_gizmos_stack();
std::string str = get_painter_type() == PainterGizmoType::SEAM if (std::string str = this->get_gizmo_leaving_text(); last_snapshot_name != str)
? _u8L("Leaving Seam painting")
: _u8L("Leaving Paint-on supports");
if (last_snapshot_name != str)
Plater::TakeSnapshot(plater, str); Plater::TakeSnapshot(plater, str);
m_internal_stack_active = false; m_internal_stack_active = false;
} }

View File

@ -173,6 +173,9 @@ protected:
virtual wxString handle_snapshot_action_name(bool shift_down, Button button_down) const = 0; virtual wxString handle_snapshot_action_name(bool shift_down, Button button_down) const = 0;
virtual std::string get_gizmo_entering_text() const = 0;
virtual std::string get_gizmo_leaving_text() const = 0;
friend class ::Slic3r::GUI::GLGizmoMmuSegmentation; friend class ::Slic3r::GUI::GLGizmoMmuSegmentation;
}; };

View File

@ -20,6 +20,9 @@ protected:
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering Seam painting"); }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving Seam painting"); }
private: private:
bool on_init() override; bool on_init() override;