diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index fc579ff84..07e43d179 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -845,6 +845,13 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott ImGui::SameLine(); if (m_current_tool == ImGui::GapFillIcon) { + m_imgui->disabled_begin(!(TriangleSelectorPatch::exist_gap_area)); + ImGui::PushStyleColor(ImGuiCol_Button, m_is_dark_mode ? ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0) : ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, + m_is_dark_mode ? ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f) : ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, + m_is_dark_mode ? ImVec4(206 / 255.0f, 206 / 255.0f, 206 / 255.0f, 1.00f) : ImVec4(206 / 255.0f, 206 / 255.0f, 206 / 255.0f, 1.00f)); + ImGui::PushStyleColor(ImGuiCol_Text, m_is_dark_mode ? ImVec4(255 / 255.0f, 255 / 255.0f, 255 / 255.0f, 1.00f) : ImVec4(255 / 255.0f, 255 / 255.0f, 255 / 255.0f, 1.00f)); if (m_imgui->button(m_desc.at("perform"))) { Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Gap fill", UndoRedo::SnapshotType::GizmoAction); @@ -856,7 +863,8 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott update_model_object(); m_parent.set_as_dirty(); } - + ImGui::PopStyleColor(4); + m_imgui->disabled_end(); ImGui::SameLine(); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index 87c238118..c5e504cdc 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -1328,6 +1328,7 @@ bool TrianglePatch::is_fragment() const } float TriangleSelectorPatch::gap_area = TriangleSelectorPatch::GapAreaMin; +bool TriangleSelectorPatch::exist_gap_area = false; void TriangleSelectorPatch::render(ImGuiWrapper* imgui) { @@ -1359,7 +1360,7 @@ void TriangleSelectorPatch::render(ImGuiWrapper* imgui) shader->set_uniform("show_wireframe", false); } } - + TriangleSelectorPatch::exist_gap_area = false; for (size_t buffer_idx = 0; buffer_idx < m_triangle_patches.size(); ++buffer_idx) { if (this->has_VBOs(buffer_idx)) { const TrianglePatch& patch = m_triangle_patches[buffer_idx]; @@ -1368,6 +1369,7 @@ void TriangleSelectorPatch::render(ImGuiWrapper* imgui) size_t color_idx = (size_t)*patch.neighbor_types.begin(); color = m_ebt_colors[color_idx]; color[3] = 0.85; + TriangleSelectorPatch::exist_gap_area = true; } else { size_t color_idx = (size_t)patch.type; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp index f5ad08a6c..f72a51db3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp @@ -150,6 +150,7 @@ public: // BBS: fix me static float gap_area; + static bool exist_gap_area; protected: // Release the geometry data, release OpenGL VBOs.