Skip to content

Commit ead060e

Browse files
committed
fix: improve resetViewState to avoid animation glitches
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
1 parent 564c3ce commit ead060e

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

qml/windowed/AppListView.qml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ FocusScope {
2020
property var categoryMenu: null
2121

2222
function resetViewState() {
23-
listView.positionViewAtBeginning()
23+
// 临时禁用highlightFollowsCurrentItem以避免动画
24+
let wasFollowing = listView.highlightFollowsCurrentItem
25+
listView.highlightFollowsCurrentItem = false
26+
listView.currentIndex = 0
27+
listView.contentY = 0
28+
listView.highlightFollowsCurrentItem = wasFollowing
2429
if (!LauncherController.visible) {
2530
alphabetCategoryPopup.close()
2631
if (categoryMenu) categoryMenu.close()

qml/windowed/FreeSortListView.qml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ Item {
4040
}
4141

4242
function resetViewState() {
43-
positionViewAtBeginning()
43+
// 临时禁用highlightFollowsCurrentItem以避免动画
44+
let wasFollowing = listView.highlightFollowsCurrentItem
45+
listView.highlightFollowsCurrentItem = false
46+
listView.currentIndex = 0
47+
listView.contentY = 0
48+
listView.highlightFollowsCurrentItem = wasFollowing
4449
}
4550

4651
ListView {

0 commit comments

Comments
 (0)