Added name for items in undo/redo stack inside multi-material gizmo.

This commit is contained in:
Lukáš Hejl 2021-06-03 18:11:48 +02:00
parent 6ed4885d01
commit cc913d52ef
8 changed files with 84 additions and 260 deletions

View file

@ -12,9 +12,7 @@
#include <GL/glew.h>
namespace Slic3r {
namespace GUI {
namespace Slic3r::GUI {
@ -115,7 +113,7 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
m_imgui->text("");
if (m_imgui->button(m_desc.at("remove_all"))) {
Plater::TakeSnapshot(wxGetApp().plater(), wxString(_L("Reset selection")));
Plater::TakeSnapshot snapshot(wxGetApp().plater(), wxString(_L("Reset selection")));
ModelObject* mo = m_c->selection_info()->model_object();
int idx = -1;
for (ModelVolume* mv : mo->volumes) {
@ -194,9 +192,10 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
ImGui::SameLine(clipping_slider_left);
ImGui::PushItemWidth(window_width - clipping_slider_left);
float clp_dist = m_c->object_clipper()->get_position();
auto clp_dist = float(m_c->object_clipper()->get_position());
if (ImGui::SliderFloat(" ", &clp_dist, 0.f, 1.f, "%.2f"))
m_c->object_clipper()->set_position(clp_dist, true);
m_c->object_clipper()->set_position(clp_dist, true);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(max_tooltip_width);
@ -260,7 +259,18 @@ PainterGizmoType GLGizmoSeam::get_painter_type() const
return PainterGizmoType::SEAM;
}
wxString GLGizmoSeam::handle_snapshot_action_name(bool shift_down, GLGizmoPainterBase::Button button_down) const
{
wxString action_name;
if (shift_down)
action_name = _L("Remove selection");
else {
if (button_down == Button::Left)
action_name = _L("Enforce seam");
else
action_name = _L("Block seam");
}
return action_name;
}
} // namespace GUI
} // namespace Slic3r
} // namespace Slic3r::GUI