diff --git a/applets/notifications/package/contents/ui/FullRepresentation.qml b/applets/notifications/package/contents/ui/FullRepresentation.qml index 386dd4d3a..0b13b6e2d 100644 --- a/applets/notifications/package/contents/ui/FullRepresentation.qml +++ b/applets/notifications/package/contents/ui/FullRepresentation.qml @@ -430,6 +430,7 @@ PlasmaComponents3.Page { inGroup: model.isInGroup inHistory: true + listViewParent: list applicationName: model.applicationName applicationIconSource: model.applicationIconName diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml index 16b6350fb..0b25959f6 100644 --- a/applets/notifications/package/contents/ui/NotificationItem.qml +++ b/applets/notifications/package/contents/ui/NotificationItem.qml @@ -27,6 +27,7 @@ ColumnLayout { property bool inGroup: false property bool inHistory: false + property ListView listViewParent: null property alias applicationIconSource: notificationHeading.applicationIconSource property alias applicationName: notificationHeading.applicationName @@ -241,6 +242,7 @@ ColumnLayout { SelectableLabel { id: bodyLabel + listViewParent: notificationItem.listViewParent // FIXME how to assign this via State? target: bodyLabel.Layout doesn't work and just assigning the property doesn't either Layout.alignment: notificationItem.inGroup ? Qt.AlignTop : Qt.AlignVCenter Layout.fillWidth: true diff --git a/applets/notifications/package/contents/ui/SelectableLabel.qml b/applets/notifications/package/contents/ui/SelectableLabel.qml index 125b1a504..bc9e04e22 100644 --- a/applets/notifications/package/contents/ui/SelectableLabel.qml +++ b/applets/notifications/package/contents/ui/SelectableLabel.qml @@ -23,6 +23,7 @@ PlasmaComponents3.ScrollView { property int cursorShape property QtObject contextMenu: null + property ListView listViewParent: null signal clicked(var mouse) signal linkActivated(string link) @@ -87,6 +88,18 @@ PlasmaComponents3.ScrollView { }); contextMenu.open(mouse.x, mouse.y); } + + // Pass wheel events to ListView to make scrolling work in FullRepresentation. + onWheel: { + if (bodyTextContainer.listViewParent + && ((wheel.angleDelta.y > 0 && !bodyTextContainer.listViewParent.atYBeginning) + || (wheel.angleDelta.y < 0 && !bodyTextContainer.listViewParent.atYEnd))) { + bodyTextContainer.listViewParent.contentY -= wheel.angleDelta.y; + wheel.accepted = true; + } else { + wheel.accepted = false; + } + } } }