Internals: Drag/Sliders: simplified some code.
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index c0de761..ecae7d0 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -2166,7 +2166,6 @@
// Tabbing or CTRL-clicking on Drag turns it into an input box
const bool hovered = ItemHoverable(frame_bb, id);
bool temp_input_is_active = TempInputIsActive(id);
- bool temp_input_start = false;
if (!temp_input_is_active)
{
const bool focus_requested = FocusableItemRegister(window, id);
@@ -2180,14 +2179,14 @@
g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
if (focus_requested || (clicked && g.IO.KeyCtrl) || double_clicked || g.NavInputId == id)
{
- temp_input_start = true;
+ temp_input_is_active = true;
FocusableItemUnregister(window);
}
}
}
// Our current specs do NOT clamp when using CTRL+Click manual input, but we should eventually add a flag for that..
- if (temp_input_is_active || temp_input_start)
+ if (temp_input_is_active)
return TempInputScalar(frame_bb, id, label, data_type, p_data, format);// , p_min, p_max);
// Draw frame
@@ -2638,7 +2637,6 @@
// Tabbing or CTRL-clicking on Slider turns it into an input box
const bool hovered = ItemHoverable(frame_bb, id);
bool temp_input_is_active = TempInputIsActive(id);
- bool temp_input_start = false;
if (!temp_input_is_active)
{
const bool focus_requested = FocusableItemRegister(window, id);
@@ -2651,14 +2649,14 @@
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
if (focus_requested || (clicked && g.IO.KeyCtrl) || g.NavInputId == id)
{
- temp_input_start = true;
+ temp_input_is_active = true;
FocusableItemUnregister(window);
}
}
}
// Our current specs do NOT clamp when using CTRL+Click manual input, but we should eventually add a flag for that..
- if (temp_input_is_active || temp_input_start)
+ if (temp_input_is_active)
return TempInputScalar(frame_bb, id, label, data_type, p_data, format);// , p_min, p_max);
// Draw frame