fix: 修复应用图标拖拽异常的问题

应用拖拽时,未移入对应的位置时,松手时都应返回原位置

Log: 修复应用图标拖拽顺序异常的问题
Influence: 应用图标拖拽(开特效或不开特效)
Bug: https://pms.uniontech.com/zentao/bug-view-111296.html
Change-Id: Ic84846b8a7d86559ea7d089252233f55506addce
This commit is contained in:
fanpengcheng 2022-01-17 13:06:54 +08:00
parent 389f7824c1
commit c57c11539f
2 changed files with 1 additions and 24 deletions

View File

@ -243,8 +243,6 @@ bool AppDragWidget::isRemoveable(const Position &dockPos, const QRect &doctRect)
return true;
}
break;
default:
break;
}
return false;
}

View File

@ -856,28 +856,7 @@ DockItem *MainPanelControl::dropTargetItem(DockItem *sourceItem, QPoint point)
if (!targetItem && parentWidget == m_appAreaSonWidget) {
// appitem调整顺序是判断是否拖放在两边空白区域
if (!m_appAreaSonLayout->count())
return targetItem;
DockItem *first = qobject_cast<DockItem *>(m_appAreaSonLayout->itemAt(0)->widget());
DockItem *last = qobject_cast<DockItem *>(m_appAreaSonLayout->itemAt(m_appAreaSonLayout->count() - 1)->widget());
if (m_position == Dock::Top || m_position == Dock::Bottom) {
if (point.x() < 0) {
targetItem = first;
} else {
targetItem = last;
}
} else {
if (point.y() < 0) {
targetItem = first;
} else {
targetItem = last;
}
}
targetItem = sourceItem;
}
return targetItem;