Skip to content

Commit f7dee62

Browse files
authored
Disabled drag-an-drop to disabled widget (#744)
1 parent 0a42eee commit f7dee62

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/OvUI/include/OvUI/Plugins/DDTarget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ namespace OvUI::Plugins
4141

4242
if (p_context == EPluginExecutionContext::WIDGET)
4343
{
44+
// If the widget is disabled, don't accept drag-and-drop
45+
if ((GImGui->CurrentItemFlags & ImGuiItemFlags_Disabled) != 0)
46+
return;
47+
4448
const ImGuiID itemID = ImGui::GetItemID();
4549
const ImGuiID targetSeed = itemID != 0 ? itemID : ImGui::GetID(this);
4650
const ImGuiID targetID = ImHashStr(identifier.c_str(), 0, targetSeed);

0 commit comments

Comments
 (0)