From d1d9a82cce5e7b2c76a81c8dfff4c095b8e8ae2e Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 27 Jun 2024 11:06:08 +0200 Subject: [PATCH] Fix for #12898 - Wrong tooltip on macos + Fixed tooltips for layers double slider --- src/slic3r/GUI/DoubleSliderForLayers.cpp | 7 +++++-- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/DoubleSliderForLayers.cpp b/src/slic3r/GUI/DoubleSliderForLayers.cpp index 42e6ae85f11..fb7deef9ce4 100644 --- a/src/slic3r/GUI/DoubleSliderForLayers.cpp +++ b/src/slic3r/GUI/DoubleSliderForLayers.cpp @@ -20,6 +20,7 @@ #include "I18N.hpp" #include "ImGuiWrapper.hpp" #include "libslic3r/libslic3r.h" +#include "slic3r/GUI/GUI.hpp" // GUI::shortkey_ctrl_prefix() #include "slic3r/GUI/ImGuiDoubleSlider.hpp" #include "slic3r/GUI/ImGuiPureWrap.hpp" #include "slic3r/GUI/RulerForDoubleSlider.hpp" @@ -1145,7 +1146,8 @@ std::string DSForLayers::get_tooltip(int tick/*=-1*/) _u8L("Add color change - Left click") ) + " " + _u8L("or press \"+\" key") + "\n" + ( is_osx ? - _u8L("Add another code - Ctrl + Left click") : + // TRN %1% is shortkey Ctrl prefix in respect to the OS + format(_u8L("Add another code - %1% Left click"), Slic3r::GUI::shortkey_ctrl_prefix()) : _u8L("Add another code - Right click") ); } @@ -1210,7 +1212,8 @@ std::string DSForLayers::get_tooltip(int tick/*=-1*/) if (m_focus == fiActionIcon) tooltip += "\n\n" + _u8L("Delete tick mark - Left click or press \"-\" key") + "\n" + ( is_osx ? - _u8L("Edit tick mark - Ctrl + Left click") : + // TRN %1% is shortkey Ctrl prefix in respect to the OS + format(_u8L("Edit tick mark - %1% Left click"), Slic3r::GUI::shortkey_ctrl_prefix()) : _u8L("Edit tick mark - Right click") ); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 4f3b472e217..1efb9035c75 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -324,7 +324,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l auto clp_dist = float(m_c->object_clipper()->get_position()); ImGui::SameLine(sliders_left_width); ImGui::PushItemWidth(window_width - sliders_left_width - slider_icon_width); - if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, _L("Ctrl + Mouse wheel"))) + if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, from_u8(GUI::shortkey_ctrl_prefix()) + _L("Mouse wheel"))) m_c->object_clipper()->set_position_by_ratio(clp_dist, true); ImGui::Separator(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 6c0031d3f21..62f58c757bb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -477,7 +477,7 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott auto clp_dist = float(m_c->object_clipper()->get_position()); ImGui::SameLine(sliders_left_width); ImGui::PushItemWidth(window_width - sliders_left_width - slider_icon_width); - if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, _L("Ctrl + Mouse wheel"))) + if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, from_u8(GUI::shortkey_ctrl_prefix()) + _L("Mouse wheel"))) m_c->object_clipper()->set_position_by_ratio(clp_dist, true); ImGui::Separator(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp index 13e2149f5b3..8998f337551 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp @@ -168,7 +168,7 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit) auto clp_dist = float(m_c->object_clipper()->get_position()); ImGui::SameLine(sliders_left_width); ImGui::PushItemWidth(window_width - sliders_left_width - slider_icon_width); - if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, _L("Ctrl + Mouse wheel"))) + if (m_imgui->slider_float("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true, from_u8(GUI::shortkey_ctrl_prefix()) + _L("Mouse wheel"))) m_c->object_clipper()->set_position_by_ratio(clp_dist, true); ImGui::Separator();