Drag and Drop: Added ImGuiDragDropFlags_SourceNoHoldToOpenOthers flag.

This commit is contained in:
omar
2017-11-01 17:24:17 +01:00
parent 5956fff7e2
commit 66f42324ad
3 changed files with 10 additions and 9 deletions

View File

@ -5842,7 +5842,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
bool hovered = ItemHoverable(bb, id);
// Special mode for Drag and Drop where holding button pressed for a long time while dragging another item triggers the button
if ((flags & ImGuiButtonFlags_PressedOnDragDropHold) && g.DragDropActive && !hovered)
if ((flags & ImGuiButtonFlags_PressedOnDragDropHold) && g.DragDropActive && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoHoldToOpenOthers))
if (IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem))
{
hovered = true;