mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix: 修复应用图标拖拽异常的问题
应用拖拽时,未移入对应的位置时,松手时都应返回原位置 Log: 修复应用图标拖拽顺序异常的问题 Influence: 应用图标拖拽(开特效或不开特效) Bug: https://pms.uniontech.com/zentao/bug-view-111296.html Change-Id: Ic84846b8a7d86559ea7d089252233f55506addce
This commit is contained in:
parent
389f7824c1
commit
c57c11539f
@ -243,8 +243,6 @@ bool AppDragWidget::isRemoveable(const Position &dockPos, const QRect &doctRect)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user