diff --git a/src/libslic3r/Color.hpp b/src/libslic3r/Color.hpp index 870481d19..c6caa3f6e 100644 --- a/src/libslic3r/Color.hpp +++ b/src/libslic3r/Color.hpp @@ -64,7 +64,8 @@ public: static const ColorRGB REDISH() { return { 1.0f, 0.5f, 0.5f }; } static const ColorRGB YELLOW() { return { 1.0f, 1.0f, 0.0f }; } static const ColorRGB WHITE() { return { 1.0f, 1.0f, 1.0f }; } - static const ColorRGB ORCA() { return {0.0f, 150.f / 255.0f, 136.0f / 255}; } + static const ColorRGB ORCA() { return {0.0f, 150.f / 255.0f, 136.0f / 255}; } + static const ColorRGB WARNING() { return {241.0f / 255, 117.f / 255.0f, 78.0f / 255}; } static const ColorRGB X() { return { 0.75f, 0.0f, 0.0f }; } static const ColorRGB Y() { return { 0.0f, 0.75f, 0.0f }; } diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 41ae5a377..725053972 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -948,7 +948,7 @@ void MenuFactory::append_menu_items_convert_unit(wxMenu* menu) void MenuFactory::append_menu_item_merge_to_multipart_object(wxMenu* menu) { - append_menu_item(menu, wxID_ANY, _L("Combinate"), _L("Assemble the selected objects to an object with multiple parts"), + append_menu_item(menu, wxID_ANY, _L("Merge"), _L("Assemble the selected objects to an object with multiple parts"), [](wxCommandEvent&) { obj_list()->merge(true); }, "", menu, []() { return obj_list()->can_merge_to_multipart_object(); }, m_parent); } @@ -956,7 +956,7 @@ void MenuFactory::append_menu_item_merge_to_multipart_object(wxMenu* menu) void MenuFactory::append_menu_item_merge_to_single_object(wxMenu* menu) { menu->AppendSeparator(); - append_menu_item(menu, wxID_ANY, _L("Combinate"), _L("Assemble the selected objects to an object with single part"), + append_menu_item(menu, wxID_ANY, _L("Merge"), _L("Assemble the selected objects to an object with single part"), [](wxCommandEvent&) { obj_list()->merge(false); }, "", menu, []() { return obj_list()->can_merge_to_single_object(); }, m_parent); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp index 57553b410..92da7a1c6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp @@ -2270,10 +2270,11 @@ void GLGizmoAdvancedCut::render_input_window_warning() const (m_info_stats.outside_bb == 1 ? _L("connector is out of object") : _L("connectors is out of object")); if (m_info_stats.is_overlap) out += "\n - " + _L("Some connectors are overlapped"); - m_imgui->text(out); + m_imgui->warning_text(out); + } + if (!m_keep_upper && !m_keep_lower) { + m_imgui->warning_text(/*wxString(ImGui::WarningMarkerSmall)*/ _L("Warning") + ": " + _L("Invalid state. \nNo one part is selected to keep after cut")); } - if (!m_keep_upper && !m_keep_lower) - m_imgui->text(/*wxString(ImGui::WarningMarkerSmall)*/_L("Warning") + ": " + _L("Invalid state. \nNo one part is selected to keep after cut")); } bool GLGizmoAdvancedCut::render_reset_button(const std::string &label_id, const std::string &tooltip) const diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAssembly.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAssembly.cpp index 5326bdc76..924ab29a7 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAssembly.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAssembly.cpp @@ -131,7 +131,8 @@ void GLGizmoAssembly::render_input_window_warning(bool same_model_object) if (wxGetApp().plater()->canvas3D()->get_canvas_type() == GLCanvas3D::ECanvasType::CanvasView3D) { if (m_hit_different_volumes.size() == 2) { if (same_model_object == false) { - m_imgui->text(_L("Warning") + ": " + _L("Due to ensuer_on_bed, assembly between \ndifferent objects may not be correct in 3D view.\n It is recommended to assemble them together.")); + m_imgui->warning_text(_L("Warning") + ": " + + _L("It is recommended to assemble the objects first,\nbecause the objects is restriced to bed \nand only parts can be lifted.")); } } } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 87824b2f3..60fb4cbe0 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -1867,14 +1867,14 @@ void GLGizmoMeasure::show_selection_ui() if (m_selected_wrong_feature_waring_tip) { if (m_measure_mode == EMeasureMode::ONLY_ASSEMBLY) { if (m_assembly_mode == AssemblyMode::FACE_FACE) { - m_imgui->text(_L("Warning:please select Plane's feature.")); + m_imgui->warning_text(_L("Warning:please select Plane's feature.")); } else if (m_assembly_mode == AssemblyMode::POINT_POINT) { - m_imgui->text(_L("Warning:please select Point's or Circle's feature.")); + m_imgui->warning_text(_L("Warning:please select Point's or Circle's feature.")); } } } if (m_measure_mode == EMeasureMode::ONLY_ASSEMBLY && m_hit_different_volumes.size() == 1) { - m_imgui->text(_L("Warning:please select two different mesh.")); + m_imgui->warning_text(_L("Warning:please select two different mesh.")); } } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp index f40451ca5..91e8e0342 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp @@ -398,7 +398,7 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l void GLGizmoMeshBoolean::render_input_window_warning(const std::string &text) { if (text.size() > 0) { - m_imgui->text(_L("Warning") + ": " + _L(text)); + m_imgui->warning_text(_L("Warning") + ": " + _L(text)); } } diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 788a37fd9..b927655c4 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -811,12 +811,15 @@ ImFontAtlasCustomRect *ImGuiWrapper::GetTextureCustomRect(const wchar_t &tex_id) return (item != m_custom_glyph_rects_ids.end()) ? ImGui::GetIO().Fonts->GetCustomRectByIndex(m_custom_glyph_rects_ids[tex_id]) : nullptr; } -ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA &color) -{ - return ImGui::GetColorU32({color.r(), color.g(), color.b(), color.a()}); +ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA &color) +{ + return ImGui::GetColorU32({color.r(), color.g(), color.b(), color.a()}); } + +ImVec4 ImGuiWrapper::to_ImVec4(const ColorRGB &color) { + return {color.r(), color.g(), color.b(), 1.0}; } -ImVec4 ImGuiWrapper::to_ImVec4(const ColorRGBA &color) { +ImVec4 ImGuiWrapper::to_ImVec4(const ColorRGBA &color) { return {color.r(), color.g(), color.b(), color.a()}; } @@ -988,6 +991,19 @@ void ImGuiWrapper::text(const wxString &label) this->text(label_utf8.c_str()); } +void ImGuiWrapper::warning_text(const char *label) +{ + ImGui::PushStyleColor(ImGuiCol_Text, ImGuiWrapper::to_ImVec4(ColorRGB::WARNING())); + this->text(label); + ImGui::PopStyleColor(); +} + +void ImGuiWrapper::warning_text(const wxString &all_text) +{ + auto label_utf8 = into_u8(all_text); + warning_text(label_utf8.c_str()); +} + void ImGuiWrapper::text_colored(const ImVec4& color, const char* label) { ImGui::TextColored(color, "%s", label); diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index f87729224..0036be9a8 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -119,6 +119,7 @@ public: bool radio_button(const wxString &label, bool active); static ImU32 to_ImU32(const ColorRGBA &color); + static ImVec4 to_ImVec4(const ColorRGB &color); static ImVec4 to_ImVec4(const ColorRGBA &color); static ColorRGBA from_ImU32(const ImU32 &color); static ColorRGBA from_ImVec4(const ImVec4 &color); @@ -142,6 +143,8 @@ public: void text(const char *label); void text(const std::string &label); void text(const wxString &label); + void warning_text(const char *all_text); + void warning_text(const wxString &all_text); void text_colored(const ImVec4& color, const char* label); void text_colored(const ImVec4& color, const std::string& label); void text_colored(const ImVec4& color, const wxString& label);