ENH:set the warning text to yellow in gizmos
jira: none Change-Id: Iaf71528f5f877452dee579ce1c827f5eaa93e4c4
This commit is contained in:
parent
dc0df83393
commit
06be80bcd0
|
@ -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 }; }
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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."));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -813,7 +813,10 @@ ImFontAtlasCustomRect *ImGuiWrapper::GetTextureCustomRect(const wchar_t &tex_id)
|
|||
|
||||
ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA &color)
|
||||
{
|
||||
return ImGui::GetColorU32({color.r(), color.g(), color.b(), color.a()});
|
||||
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) {
|
||||
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue