You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support item hovering state in drag and drop #8632
I am using drag and drop functionality to implement reordering and removal of items in a table. For a removal there is a button at the bottom of the screen (see picture).
Currently AcceptDragDropPayload only supports rendering of a yellow bounding rectangle when the removal button is hovered. It would be nice to add support for ordinary hovering state so that buttons or selectables render as hovered. For example we could have a new flag ImGuiDragDropFlags_AcceptDrawHovered
Apologies for my late answer.
This seems sensible, I pushed b0d3c3a + bd0e203, the later adding a new ImGuiDragDropFlags_AcceptDrawAsHovered flag as suggested.
ImGui::Button("Drop Me");
if (ImGui::BeginDragDropTarget())
{
if (ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F, ImGuiDragDropFlags_AcceptNoDrawDefaultRect | ImGuiDragDropFlags_AcceptDrawAsHovered))
{
IMGUI_DEBUG_LOG("Dropped\n");
}
ImGui::EndDragDropTarget();
}
Please note that as #9056 you can also slightly configure the drop rect highlight, but I presume that in this sorts of case you would use ImGuiDragDropFlags_AcceptNoDrawDefaultRect anyhow.
Activity
Drag and Drop: added ImGuiDragDropFlags_AcceptDrawAsHovered. (#8632)
ocornut commentedon Nov 6, 2025
Apologies for my late answer.
This seems sensible, I pushed b0d3c3a + bd0e203, the later adding a new
ImGuiDragDropFlags_AcceptDrawAsHoveredflag as suggested.Please note that as #9056 you can also slightly configure the drop rect highlight, but I presume that in this sorts of case you would use
ImGuiDragDropFlags_AcceptNoDrawDefaultRectanyhow.Drag and Drop: added ImGuiDragDropFlags_AcceptDrawAsHovered. (ocornut…