bugfix: drag in a small area will change item's position

Change-Id: Id6a114351a5103f1f6686a3f5c5d4fd92c1dcaa4
This commit is contained in:
杨万青 2015-08-26 17:24:28 +08:00
parent b10111dffd
commit 787c259f20
Notes: Deepin Code Review 2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: Hualet Wang <mr.asianwang@gmail.com>
Submitted-by: Hualet Wang <mr.asianwang@gmail.com>
Submitted-at: Wed, 26 Aug 2015 18:20:40 +0800
Reviewed-on: https://cr.deepin.io/6604
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 5 additions and 2 deletions

View File

@ -42,6 +42,10 @@ void DockLayout::insertItem(AbstractDockItem *item, int index)
m_ddam->Sort(itemsIdList());
relayout();
//reset state
m_movingLeftward = true;
m_animationItemCount = 0;
}
void DockLayout::moveItem(int from, int to)
@ -142,7 +146,6 @@ void DockLayout::restoreTmpItem()
}
emit itemDropped();
m_animationItemCount = 0;
}
void DockLayout::clearTmpItem()

View File

@ -85,7 +85,7 @@ private:
QPoint m_lastPost = QPoint(0,0);
int m_lastHoverIndex = -1;
int m_animationItemCount = 0;
bool m_movingLeftward = false;
bool m_movingLeftward = true;
const int MOVE_ANIMATION_DURATION_BASE = 300;
};