DoubleSlider: Using for the "Ctrl/Shift + MouseWhile" didn't increase move step.

MacOS specific: MouseWhile issue. + Wrong tooltip for tick editing ("cmd" instead of "Ctrl" -> partially reverted d1d9a82c)
Fixes are related to GH#12944 - Sliced view scrolling needs attention
This commit is contained in:
YuSanka 2024-07-17 14:51:51 +02:00 committed by Lukas Matena
parent e4fc20d07c
commit d361b663a2
2 changed files with 11 additions and 7 deletions

View File

@ -20,7 +20,6 @@
#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"
@ -1146,8 +1145,7 @@ std::string DSForLayers::get_tooltip(int tick/*=-1*/)
_u8L("Add color change - Left click") ) + " " +
_u8L("or press \"+\" key") + "\n" + (
is_osx ?
// 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 - Ctrl + Left click") :
_u8L("Add another code - Right click") );
}
@ -1212,8 +1210,7 @@ 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 ?
// 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 - Ctrl + Left click") :
_u8L("Edit tick mark - Right click") );
}

View File

@ -49,8 +49,15 @@ static bool behavior(ImGuiID id, const ImRect& region,
if (ImGui::ItemHoverable(mouse_wheel_responsive_region, id)) {
if (change_on_mouse_move)
v_new = v_min + (ImS32)(v_range * mouse_pos_ratio + 0.5f);
else
v_new = ImClamp(*out_value + (ImS32)(context.IO.MouseWheel/* * accer*/), v_min, v_max);
else {
float mw = context.IO.MouseWheel;
#if defined(__APPLE__)
if (mw > 0.f) mw = 1.f;
if (mw < 0.f) mw = -1.f;
#endif
const float accer = context.IO.KeyCtrl || context.IO.KeyShift ? 5.f : 1.f;
v_new = ImClamp(*out_value + (ImS32)(mw * accer), v_min, v_max);
}
}
// drag behavior