mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 03:45:32 +00:00
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();
|
||||
}
|
||||
|
||||
void DragAndDrop::onFrame()
|
||||
{
|
||||
if (mIsOnDragAndDrop && mItem.mBase.getRefData().getCount() == 0)
|
||||
finish();
|
||||
}
|
||||
|
||||
void DragAndDrop::finish()
|
||||
{
|
||||
mIsOnDragAndDrop = false;
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace MWGui
|
|||
|
||||
void startDrag (int index, SortFilterItemModel* sortModel, ItemModel* sourceModel, ItemView* sourceView, int count);
|
||||
void drop (ItemModel* targetModel, ItemView* targetView);
|
||||
void onFrame();
|
||||
|
||||
void finish();
|
||||
};
|
||||
|
|
|
@ -876,11 +876,7 @@ namespace MWGui
|
|||
MWBase::StateManager::State_NoGame)
|
||||
return;
|
||||
|
||||
if (mDragAndDrop->mIsOnDragAndDrop)
|
||||
{
|
||||
assert(mDragAndDrop->mDraggedWidget);
|
||||
mDragAndDrop->mDraggedWidget->setPosition(MyGUI::InputManager::getInstance().getMousePosition());
|
||||
}
|
||||
mDragAndDrop->onFrame();
|
||||
|
||||
updateMap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue