From e70fb37bae1383c835ff2cde12b0455c834716ab Mon Sep 17 00:00:00 2001 From: Robertkill Date: Tue, 30 Dec 2025 13:22:55 +0800 Subject: [PATCH] fix: improve resetViewState to avoid animation glitches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Modified resetViewState function in AppListView.qml and FreeSortListView.qml 2. Temporarily disable highlightFollowsCurrentItem property during reset 3. Set currentIndex to 0 and contentY to 0 to ensure proper reset 4. Restore original highlightFollowsCurrentItem state after reset 5. This prevents animation glitches when resetting view state Log: Fixed animation issues when resetting application list view Influence: 1. Test resetting application list view after search or category filtering 2. Verify that no animation glitches occur during view reset 3. Check that current selection is properly reset to first item 4. Test with different highlight modes and settings 5. Verify that view position is correctly reset to top fix: 改进 resetViewState 函数以避免动画闪烁问题 1. 修改 AppListView.qml 和 FreeSortListView.qml 中的 resetViewState 函数 2. 在重置过程中临时禁用 highlightFollowsCurrentItem 属性 3. 将 currentIndex 设置为 0,contentY 设置为 0 以确保正确重置 4. 重置后恢复原始的 highlightFollowsCurrentItem 状态 5. 这可以防止重置视图状态时出现动画闪烁问题 Log: 修复重置应用列表视图时的动画问题 Influence: 1. 测试在搜索或分类筛选后重置应用列表视图 2. 验证在视图重置过程中不会出现动画闪烁 3. 检查当前选择是否正确重置到第一个项目 4. 使用不同的高亮模式和设置进行测试 5. 验证视图位置是否正确重置到顶部 PMS: BUG-346111 --- qml/windowed/AppListView.qml | 7 ++++++- qml/windowed/FreeSortListView.qml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qml/windowed/AppListView.qml b/qml/windowed/AppListView.qml index 6f4f1d82..6abdb036 100644 --- a/qml/windowed/AppListView.qml +++ b/qml/windowed/AppListView.qml @@ -20,7 +20,12 @@ FocusScope { property var categoryMenu: null function resetViewState() { - listView.positionViewAtBeginning() + // 临时禁用highlightFollowsCurrentItem以避免动画 + let wasFollowing = listView.highlightFollowsCurrentItem + listView.highlightFollowsCurrentItem = false + listView.currentIndex = 0 + listView.contentY = 0 + listView.highlightFollowsCurrentItem = wasFollowing if (!LauncherController.visible) { alphabetCategoryPopup.close() if (categoryMenu) categoryMenu.close() diff --git a/qml/windowed/FreeSortListView.qml b/qml/windowed/FreeSortListView.qml index 046c710a..c7f7ffc9 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -40,7 +40,12 @@ Item { } function resetViewState() { - positionViewAtBeginning() + // 临时禁用highlightFollowsCurrentItem以避免动画 + let wasFollowing = listView.highlightFollowsCurrentItem + listView.highlightFollowsCurrentItem = false + listView.currentIndex = 0 + listView.contentY = 0 + listView.highlightFollowsCurrentItem = wasFollowing } ListView {