mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-18 17:11:23 +01:00
Drag and Drop: Pressing Escape while carrying a payload automatically cancel the active drag and drop. (#9071)
This commit is contained in:
@@ -122,6 +122,8 @@ Other Changes:
|
||||
- Drag and Drop:
|
||||
- Added ImGuiDragDropFlags_AcceptDrawAsHovered to make accepting item render
|
||||
as hovered, which can allow using e.g. Button() as drop target. (#8632)
|
||||
- Pressing Escape while carrying a payload automatically cancel the
|
||||
active drag and drop. (#9071)
|
||||
- Style: added ImGuiCol_DragDropTargetBg, style.DragDropTargetRounding,
|
||||
style.DragDropTargetBorderSize and style.DragDropTargetPadding to configure
|
||||
the drop target highlight. (#9056) [@aaronkirkham]
|
||||
|
||||
@@ -5534,6 +5534,11 @@ void ImGui::NewFrame()
|
||||
g.DragDropWithinSource = false;
|
||||
g.DragDropWithinTarget = false;
|
||||
g.DragDropHoldJustPressedId = 0;
|
||||
if (g.DragDropActive && IsKeyPressed(ImGuiKey_Escape, ImGuiInputFlags_None, g.ActiveId)) // Also works when g.ActiveId==0 (aka leftover payload in progress, no active id)
|
||||
{
|
||||
ClearActiveID();
|
||||
ClearDragDrop();
|
||||
}
|
||||
g.TooltipPreviousWindow = NULL;
|
||||
|
||||
// Close popups on focus lost (currently wip/opt-in)
|
||||
|
||||
Reference in New Issue
Block a user