Skip to content

Commit 4cfc7fa

Browse files
committed
fix: remove category check from resetViewState
1. Removed conditional check for FreeCategory in AppList.qml's resetViewState function 2. Added resetViewState implementation to FreeSortListView.qml that calls positionViewAtBeginning 3. Now resetViewState works consistently across all category types 4. Previously resetViewState was only working for non-FreeCategory views fix: 从 resetViewState 中移除类别检查 1. 移除了 AppList.qml 中 resetViewState 函数对 FreeCategory 的条件检查 2. 在 FreeSortListView.qml 中添加了 resetViewState 实现,调用 positionViewAtBeginning 3. 现在 resetViewState 在所有类别类型中都能一致工作 4. 之前 resetViewState 仅对非 FreeCategory 视图有效 Pms: BUG-335941
1 parent 0f703a4 commit 4cfc7fa

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

qml/windowed/AppList.qml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ ColumnLayout {
2626
}
2727

2828
function resetViewState() {
29-
if (CategorizedSortProxyModel.categoryType !== CategorizedSortProxyModel.FreeCategory) {
30-
loader.item.resetViewState()
31-
}
29+
loader.item.resetViewState()
3230
}
3331

3432
function switchToFreeSort(freeSort) {

qml/windowed/FreeSortListView.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Item {
3939
listView.positionViewAtBeginning()
4040
}
4141

42+
function resetViewState() {
43+
positionViewAtBeginning()
44+
}
45+
4246
ListView {
4347
id: listView
4448
anchors.fill: parent

0 commit comments

Comments
 (0)