mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-01 01:34:57 +08:00
Drag and Drop: Pressing Escape while carrying a payload automatically cancel the active drag and drop. (#9071)
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
This commit is contained in:
@@ -122,6 +122,8 @@ Other Changes:
|
|||||||
- Drag and Drop:
|
- Drag and Drop:
|
||||||
- Added ImGuiDragDropFlags_AcceptDrawAsHovered to make accepting item render
|
- Added ImGuiDragDropFlags_AcceptDrawAsHovered to make accepting item render
|
||||||
as hovered, which can allow using e.g. Button() as drop target. (#8632)
|
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: added ImGuiCol_DragDropTargetBg, style.DragDropTargetRounding,
|
||||||
style.DragDropTargetBorderSize and style.DragDropTargetPadding to configure
|
style.DragDropTargetBorderSize and style.DragDropTargetPadding to configure
|
||||||
the drop target highlight. (#9056) [@aaronkirkham]
|
the drop target highlight. (#9056) [@aaronkirkham]
|
||||||
|
|||||||
@@ -5534,6 +5534,11 @@ void ImGui::NewFrame()
|
|||||||
g.DragDropWithinSource = false;
|
g.DragDropWithinSource = false;
|
||||||
g.DragDropWithinTarget = false;
|
g.DragDropWithinTarget = false;
|
||||||
g.DragDropHoldJustPressedId = 0;
|
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;
|
g.TooltipPreviousWindow = NULL;
|
||||||
|
|
||||||
// Close popups on focus lost (currently wip/opt-in)
|
// Close popups on focus lost (currently wip/opt-in)
|
||||||
|
|||||||
Reference in New Issue
Block a user