From 45a36661ada39d16cb065c0b19abac5481713dfb Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Thu, 12 Feb 2026 17:55:51 +0800 Subject: [PATCH] fix: fix touchscreen drag issue with hidden items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Changed visibility control from `visible` property to `opacity` property in AppListView.qml and FreeSortListView.qml 2. This prevents drag interruption when items are hidden during drag operations 3. The issue occurred because setting `visible: false` during drag would interrupt the drag gesture on touchscreens 4. Using opacity instead maintains the visual hiding effect while keeping the item technically visible to the touch system Log: Fixed touchscreen drag issue where dragging would abnormally interrupt when items were hidden Influence: 1. Test touchscreen drag operations on both app list and free sort views 2. Verify that dragging items no longer interrupts when items become hidden 3. Check that visual appearance during drag is correct (items should be invisible but not disrupt drag) 4. Test mouse drag operations to ensure they still work correctly 5. Verify that tooltips and other interactive features still function properly fix: 修复触摸屏拖拽时隐藏项导致的问题 1. 在 AppListView.qml 和 FreeSortListView.qml 中将可见性控制从 `visible` 属性改为 `opacity` 属性 2. 这防止了在拖拽操作期间隐藏项目时拖拽被中断的问题 3. 问题发生在拖拽过程中设置 `visible: false` 会中断触摸屏上的拖拽手势 4. 使用透明度替代可以保持视觉隐藏效果,同时让项目在触摸系统中保持技术上 的可见性 Log: 修复了触摸屏拖拽问题,当项目隐藏时拖拽不再异常中断 Influence: 1. 测试应用列表和自由排序视图上的触摸屏拖拽操作 2. 验证拖拽项目时不再因项目隐藏而中断 3. 检查拖拽期间的视觉外观是否正确(项目应不可见但不中断拖拽) 4. 测试鼠标拖拽操作确保仍能正常工作 5. 验证工具提示和其他交互功能是否仍能正常使用 PMS: BUG-346077 --- qml/windowed/AppListView.qml | 4 ++-- qml/windowed/FreeSortListView.qml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qml/windowed/AppListView.qml b/qml/windowed/AppListView.qml index 6abdb036..4b975fa5 100644 --- a/qml/windowed/AppListView.qml +++ b/qml/windowed/AppListView.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -170,7 +170,7 @@ FocusScope { leftMargin: 10 rightMargin: 10 } - visible: !Drag.active + opacity: !Drag.active ? 1 : 0 text: model.display checkable: false icon.name: (iconName && iconName !== "") ? iconName : "application-x-desktop" diff --git a/qml/windowed/FreeSortListView.qml b/qml/windowed/FreeSortListView.qml index 93d9b35e..1e647d74 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -298,7 +298,7 @@ Item { ColorSelector.pressed: false property Palette textColor: DStyle.Style.button.text palette.windowText: ColorSelector.textColor - visible: !Drag.active && (typeof dndItem === "undefined" || dndItem.currentlyDraggedId !== model.desktopId) + opacity: !Drag.active && (typeof dndItem === "undefined" || dndItem.currentlyDraggedId !== model.desktopId) ? 1 : 0 ToolTip.text: text ToolTip.delay: 500