fix: 修改“移除”提示标的坐标计算方法

关闭特效后图标计算的坐标有误差

Log: 修复窗口特效关闭后鼠标移除任务栏图标有时会失效的问题
Influence: dock栏图标拖动
Bug: https://pms.uniontech.com/bug-view-121323.html
Change-Id: I540746f2f6bd6179cfeeb81fd7bc130f44f6b070
This commit is contained in:
chenbin 2022-04-07 09:46:38 +08:00
parent d88642fb30
commit 6cdbc693a4

View File

@ -139,7 +139,7 @@ const QPoint AppDragWidget::popupMarkPoint(Dock::Position pos)
break;
case Bottom:
if (!DWindowManagerHelper::instance()->hasComposite()) {
p += QPoint(0 , -r.height() / 2);
p += QPoint(size().width() / 2 , -r.height() / 2);
} else {
p += QPoint(r.width() / 2, 0);
}
@ -371,11 +371,7 @@ bool AppDragWidget::isRemoveItem()
void AppDragWidget::onFollowMouse()
{
QPoint destPos = QCursor::pos();
if (DWindowManagerHelper::instance()->hasComposite()) {
move(destPos.x() - width() / 2, destPos.y() - height() / 2);
} else {
move(destPos.x(), destPos.y()); // 窗口特效未开启时会隐藏m_object绘制的图标移动的图标为QDrag绘制的图标
}
move(destPos.x() - width() / 2, destPos.y() - height() / 2);
}
void AppDragWidget::enterEvent(QEvent *event)