diff --git a/modules/NotifCenter.qml b/modules/NotifCenter.qml index c5d161a..442be79 100644 --- a/modules/NotifCenter.qml +++ b/modules/NotifCenter.qml @@ -70,15 +70,18 @@ M.HoverPanel { // Collapsed groups set — reassign to trigger reactivity property var _collapsedGroups: ({}) + property real _savedScrollY: 0 + property bool _restoringScroll: false + function _toggleCollapse(appName) { - const savedY = notifList.contentY; + _savedScrollY = notifList.contentY; + _restoringScroll = true; const next = Object.assign({}, _collapsedGroups); if (next[appName]) delete next[appName]; else next[appName] = true; _collapsedGroups = next; - Qt.callLater(() => notifList.contentY = savedY); } // Group notifications by appName, sorted by max urgency desc then most recent time desc @@ -228,6 +231,13 @@ M.HoverPanel { boundsBehavior: Flickable.StopAtBounds model: menuWindow._flatModel + onContentHeightChanged: { + if (menuWindow._restoringScroll) { + contentY = Math.min(menuWindow._savedScrollY, Math.max(0, contentHeight - height)); + menuWindow._restoringScroll = false; + } + } + delegate: Item { id: notifDelegate required property var modelData