Bladeren bron

Fix UI element drags with DragDropContent defined showing a "not accepted" icon, yet succeeding when the drag is released.

Lasse Öörni 11 jaren geleden
bovenliggende
commit
7318006d83
1 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. 3 1
      Source/Engine/UI/LineEdit.cpp

+ 3 - 1
Source/Engine/UI/LineEdit.cpp

@@ -159,8 +159,10 @@ void LineEdit::OnDragMove(const IntVector2& position, const IntVector2& screenPo
 
 
 bool LineEdit::OnDragDropTest(UIElement* source)
 bool LineEdit::OnDragDropTest(UIElement* source)
 {
 {
-    if (source)
+    if (source && editable_)
     {
     {
+        if (source->GetVars().Contains(VAR_DRAGDROPCONTENT))
+            return true;
         StringHash sourceType = source->GetType();
         StringHash sourceType = source->GetType();
         return sourceType == LineEdit::GetTypeStatic() || sourceType == Text::GetTypeStatic();
         return sourceType == LineEdit::GetTypeStatic() || sourceType == Text::GetTypeStatic();
     }
     }