diff --git a/panels/notification/center/NotifyView.qml b/panels/notification/center/NotifyView.qml index 12f13a8e0..818967744 100644 --- a/panels/notification/center/NotifyView.qml +++ b/panels/notification/center/NotifyView.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 @@ -81,6 +81,17 @@ Control { expandFocusTimer.start() } + // Jiggles scroll ±1px to force ListView to re-render displaced delegates + function jiggleUpdate() { + if (contentY > 0) { + contentY--; + Qt.callLater(function() { contentY++; }); + } else { + contentY++; + Qt.callLater(function() { contentY--; }); + } + } + Timer { id: expandFocusTimer property int retries: 15 diff --git a/panels/notification/center/NotifyViewDelegate.qml b/panels/notification/center/NotifyViewDelegate.qml index 212252a08..f2ed3a970 100644 --- a/panels/notification/center/NotifyViewDelegate.qml +++ b/panels/notification/center/NotifyViewDelegate.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 @@ -69,6 +69,7 @@ DelegateChooser { console.log("collapse group", model.appName) let collapseIndex = index notifyModel.collapseApp(index) + root.view.jiggleUpdate() root.view.requestFocusOnExpand(collapseIndex) } @@ -211,6 +212,7 @@ DelegateChooser { console.log("expand") let expandIndex = model.index notifyModel.expandApp(expandIndex) + root.view.jiggleUpdate() root.view.requestFocusOnExpand(expandIndex + 1) } onSetting: function (pos) { diff --git a/panels/notification/center/notifymodel.cpp b/panels/notification/center/notifymodel.cpp index e5d01b13a..0a5be295e 100644 --- a/panels/notification/center/notifymodel.cpp +++ b/panels/notification/center/notifymodel.cpp @@ -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 @@ -129,8 +129,6 @@ void NotifyModel::collapseApp(int row) m_appNotifies.insert(row, overlap); endInsertRows(); } - - emit layoutChanged(); } void NotifyModel::close()