bugfix: drop active item outside dock cause item overlap

Change-Id: Id3ebcc9c74b21d9b86f946e112a84bcd5e8105f7
This commit is contained in:
杨万青 2015-10-22 20:56:24 +08:00
parent 065b943b92
commit b6f92bac4c
Notes: Deepin Code Review 2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: <mr.asianwang@gmail.com>
Submitted-by: <mr.asianwang@gmail.com>
Submitted-at: Fri, 23 Oct 2015 09:42:12 +0800
Reviewed-on: https://cr.deepin.io/8014
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,7 @@ signals:
void needPreviewImmediatelyHide();
void needPreviewShow(QPoint pos);
void needPreviewUpdate();
void requestAnimationFinish();
protected:
bool m_moveable = true;

View File

@ -30,6 +30,8 @@ void AppItem::moveWithAnimation(QPoint targetPos, int duration)
animation->start();
connect(animation, &QPropertyAnimation::finished, this, &AppItem::moveAnimationFinished);
connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater);
connect(this, &AppItem::requestAnimationFinish, animation, &QPropertyAnimation::stop);
connect(this, &AppItem::requestAnimationFinish, animation, &QPropertyAnimation::deleteLater);
}
AppItemData AppItem::itemData() const

View File

@ -335,6 +335,7 @@ void DockLayout::sortLeftToRight()
for (int i = 0; i < m_appList.count(); i ++)
{
AbstractDockItem * toItem = m_appList.at(i);
toItem->requestAnimationFinish();//make sure the move-animation stop for resort
int nextX = 0;
int nextY = 0;