mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
DragFloat() double-clicking turns into an input box (along with Ctrl+clicking) #180
This commit is contained in:
parent
916a8955ec
commit
962aa4c396
@ -5512,14 +5512,13 @@ bool ImGui::DragFloat(const char* label, float *v, float v_step, float v_min, fl
|
|||||||
// Tabbing or CTRL-clicking on Drag turns it into an input box
|
// Tabbing or CTRL-clicking on Drag turns it into an input box
|
||||||
bool start_text_input = false;
|
bool start_text_input = false;
|
||||||
const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId == id);
|
const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId == id);
|
||||||
if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
|
if (tab_focus_requested || (hovered && (g.IO.MouseClicked[0] | g.IO.MouseDoubleClicked[0])))
|
||||||
{
|
{
|
||||||
SetActiveId(id);
|
SetActiveId(id);
|
||||||
FocusWindow(window);
|
FocusWindow(window);
|
||||||
g.DragLastMouseDelta = ImVec2(0.f, 0.f);
|
g.DragLastMouseDelta = ImVec2(0.f, 0.f);
|
||||||
|
|
||||||
const bool is_ctrl_down = g.IO.KeyCtrl;
|
if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0])
|
||||||
if (tab_focus_requested || is_ctrl_down)
|
|
||||||
{
|
{
|
||||||
start_text_input = true;
|
start_text_input = true;
|
||||||
g.ScalarAsInputTextId = 0;
|
g.ScalarAsInputTextId = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user