Drag and Drop: ImGuiButtonFlags_PressedOnDragDropHold focuses the target window.

This commit is contained in:
omar 2017-10-30 00:10:05 +01:00
parent a810619555
commit 5956fff7e2

View File

@ -5848,7 +5848,10 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
hovered = true; hovered = true;
SetHoveredID(id); SetHoveredID(id);
if (CalcTypematicPressedRepeatAmount(g.HoveredIdTimer + 0.0001f, g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, 0.01f, 0.70f)) // FIXME: Our formula for CalcTypematicPressedRepeatAmount() is fishy if (CalcTypematicPressedRepeatAmount(g.HoveredIdTimer + 0.0001f, g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, 0.01f, 0.70f)) // FIXME: Our formula for CalcTypematicPressedRepeatAmount() is fishy
{
pressed = true; pressed = true;
FocusWindow(window);
}
} }
if ((flags & ImGuiButtonFlags_FlattenChilds) && g.HoveredRootWindow == window) if ((flags & ImGuiButtonFlags_FlattenChilds) && g.HoveredRootWindow == window)