diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2020-02-25 12:57:16 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2020-02-25 13:12:04 +0300 |
commit | c326b31c92b4288d5520b50fa883e5587d86583e (patch) | |
tree | f47b4f09021d1a95ebeb8b536ec55d616a2af246 /src/slic3r/GUI | |
parent | f475d994b3848efeb86942b89b4b9de4bdd2ba1e (diff) |
Enabled text-wrapping for tooltips in hollowing gizmo
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r-- | src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 827df2a81..43f83d11b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -752,14 +752,16 @@ RENDER_AGAIN: } m_imgui->disabled_begin(! m_enable_hollowing); - + float max_tooltip_width = ImGui::GetFontSize() * 20.0f; m_imgui->text(m_desc.at("offset")); ImGui::SameLine(settings_sliders_left); ImGui::PushItemWidth(window_width - settings_sliders_left); ImGui::SliderFloat(" ", &offset, offset_min, offset_max, "%.1f mm"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); - ImGui::TextUnformatted(_(opts[0].second->tooltip).ToUTF8()); + ImGui::PushTextWrapPos(max_tooltip_width); + ImGui::TextUnformatted((_utf8(opts[0].second->tooltip)).c_str()); + ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } bool slider_clicked = ImGui::IsItemClicked(); // someone clicked the slider @@ -772,7 +774,9 @@ RENDER_AGAIN: ImGui::SliderFloat(" ", &quality, quality_min, quality_max, "%.1f"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); - ImGui::TextUnformatted(_(opts[1].second->tooltip).ToUTF8()); + ImGui::PushTextWrapPos(max_tooltip_width); + ImGui::TextUnformatted((_utf8(opts[1].second->tooltip)).c_str()); + ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } slider_clicked |= ImGui::IsItemClicked(); @@ -786,7 +790,9 @@ RENDER_AGAIN: ImGui::SliderFloat(" ", &closing_d, closing_d_min, closing_d_max, "%.1f mm"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); - ImGui::TextUnformatted(_(opts[2].second->tooltip).ToUTF8()); + ImGui::PushTextWrapPos(max_tooltip_width); + ImGui::TextUnformatted((_utf8(opts[2].second->tooltip)).c_str()); + ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } slider_clicked |= ImGui::IsItemClicked(); |