Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions panels/notification/center/NotifyView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ Control {
property int pendingFocusIndex: -1 // Index to focus after expand operation
property bool panelShown: false

// ListView滚轮回弹行为是默认行为,需要手动修正
onHeightChanged: {
if (contentHeight > height && contentY > contentHeight - height) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这三个是一样的逻辑吧,封装一下,

contentY = Math.max(0, contentHeight - height)
}
}
onContentHeightChanged: {
if (contentHeight > height && contentY > contentHeight - height) {
contentY = Math.max(0, contentHeight - height)
}
}
onContentYChanged: {
if (contentY < -1) {
contentY = 0
} else if (contentHeight > height && contentY > contentHeight - height + 1) {
contentY = contentHeight - height
}
}

// Forward signals from delegate to root for Tab cycling
function gotoHeaderFirst() { root.gotoHeaderFirst() }
function gotoHeaderLast() { root.gotoHeaderLast() }
Expand Down
Loading