Skip to content

Commit 055f171

Browse files
wjyrichdeepin-bot[bot]
authored andcommitted
fix: disable drag when menus or popups are visible
1. Disabled drag functionality in AppListView when category menu or alphabet popup is visible 2. Disabled drag functionality in FrequentlyUsedView and RecentlyInstalledView when folder popup is visible 3. Prevents accidental drag operations while interacting with menus/ popups 4. Improves user experience by avoiding conflicting interactions fix: 菜单或弹出窗口可见时禁用拖拽功能 1. 当分类菜单或字母弹出窗口可见时,禁用AppListView中的拖拽功能 2. 当文件夹弹出窗口可见时,禁用FrequentlyUsedView和RecentlyInstalledView 中的拖拽功能 3. 防止与菜单/弹出窗口交互时意外触发拖拽操作 4. 通过避免交互冲突提升用户体验 Pms: BUG-323887
1 parent 571fd99 commit 055f171

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

qml/windowed/AppListView.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ FocusScope {
234234
target: parent
235235
acceptedButtons: Qt.LeftButton
236236
dragThreshold: 1
237+
// 当分类菜单打开时,禁用拖拽功能
238+
enabled: !(ddeCategoryMenu.visible || alphabetCategoryPopup.visible)
237239
onActiveChanged: {
238240
if (active) {
239241
// We switch to use the `dndItem` to handle Drag event since that one will always exists.

qml/windowed/FrequentlyUsedView.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Control {
5656
width: frequentlyUsedViewContainer.cellWidth
5757
height: frequentlyUsedViewContainer.cellHeight
5858
iconSource: iconName
59-
dndEnabled: true
59+
// 当文件夹打开时禁用拖拽功能
60+
dndEnabled: !folderGridViewPopup.visible
6061
Drag.mimeData: Helper.generateDragMimeData(model.desktopId, true)
6162
onItemClicked: {
6263
launchApp(desktopId)

qml/windowed/RecentlyInstalledView.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ Control {
5353
iconSource: iconName
5454
width: recentlyInstalledViewContainer.cellWidth
5555
height: recentlyInstalledViewContainer.cellHeight
56-
dndEnabled: true
56+
// 当文件夹打开时禁用拖拽功能
57+
dndEnabled: !folderGridViewPopup.visible
5758
Drag.mimeData: Helper.generateDragMimeData(model.desktopId, true)
5859
onItemClicked: {
5960
launchApp(desktopId)

0 commit comments

Comments
 (0)