forked from mirror/openmw-tes3mp
Exit drag-and-drop if dragged item is deleted (Fixes #3097)
This commit is contained in:
parent
2ce79e07a4
commit
9b91ea5d34
3 changed files with 8 additions and 5 deletions
|
@ -121,6 +121,12 @@ void DragAndDrop::drop(ItemModel *targetModel, ItemView *targetView)
|
||||||
mSourceView->update();
|
mSourceView->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DragAndDrop::onFrame()
|
||||||
|
{
|
||||||
|
if (mIsOnDragAndDrop && mItem.mBase.getRefData().getCount() == 0)
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
void DragAndDrop::finish()
|
void DragAndDrop::finish()
|
||||||
{
|
{
|
||||||
mIsOnDragAndDrop = false;
|
mIsOnDragAndDrop = false;
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace MWGui
|
||||||
|
|
||||||
void startDrag (int index, SortFilterItemModel* sortModel, ItemModel* sourceModel, ItemView* sourceView, int count);
|
void startDrag (int index, SortFilterItemModel* sortModel, ItemModel* sourceModel, ItemView* sourceView, int count);
|
||||||
void drop (ItemModel* targetModel, ItemView* targetView);
|
void drop (ItemModel* targetModel, ItemView* targetView);
|
||||||
|
void onFrame();
|
||||||
|
|
||||||
void finish();
|
void finish();
|
||||||
};
|
};
|
||||||
|
|
|
@ -876,11 +876,7 @@ namespace MWGui
|
||||||
MWBase::StateManager::State_NoGame)
|
MWBase::StateManager::State_NoGame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mDragAndDrop->mIsOnDragAndDrop)
|
mDragAndDrop->onFrame();
|
||||||
{
|
|
||||||
assert(mDragAndDrop->mDraggedWidget);
|
|
||||||
mDragAndDrop->mDraggedWidget->setPosition(MyGUI::InputManager::getInstance().getMousePosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMap();
|
updateMap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue