Skip to content

Commit

Permalink
Fix for #12898 - Wrong tooltip on macos
Browse files Browse the repository at this point in the history
+ Fixed tooltips for layers double slider
  • Loading branch information
YuSanka authored and lukasmatena committed Jul 10, 2024
1 parent 925f92c commit d1d9a82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/slic3r/GUI/DoubleSliderForLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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") );
}

Expand Down Expand Up @@ -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") );
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d1d9a82

Please sign in to comment.