Fix NotificationHistory

This commit is contained in:
Ly-sec 2025-08-15 23:41:10 +02:00
parent 7e7b7b0192
commit b371cb92c1

View file

@ -75,6 +75,7 @@ NLoader {
anchors.right: parent.right
anchors.topMargin: Style.marginTiny * scaling
anchors.rightMargin: Style.marginTiny * scaling
clip: true
// Animation properties
property real scaleValue: 0.8
@ -152,7 +153,7 @@ NLoader {
Layout.fillHeight: true
model: NotificationService.historyModel
spacing: Style.marginMedium * scaling
clip: false
clip: true
boundsBehavior: Flickable.StopAtBounds
delegate: Rectangle {
@ -181,7 +182,7 @@ NLoader {
font.weight: Font.Medium
color: notificationMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurface
wrapMode: Text.Wrap
width: parent.width - 30
width: parent.width - 60
maximumLineCount: 2
elide: Text.ElideRight
}
@ -191,7 +192,7 @@ NLoader {
font.pointSize: Style.fontSizeSmall * scaling
color: notificationMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurface
wrapMode: Text.Wrap
width: parent.width - 30
width: parent.width - 60
maximumLineCount: 3
elide: Text.ElideRight
}
@ -202,12 +203,13 @@ NLoader {
color: notificationMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurface
}
}
}
MouseArea {
id: notificationMouseArea
anchors.fill: parent
hoverEnabled: true
// Trash icon button
NIconButton {
icon: "delete"
sizeMultiplier: 0.7
tooltipText: "Delete notification"
color: notificationMouseArea.containsMouse ? Colors.mSurface : Colors.mOnSurfaceVariant
onClicked: {
console.log("[NotificationHistory] Removing notification:", summary)
NotificationService.historyModel.remove(index)
@ -216,6 +218,15 @@ NLoader {
}
}
MouseArea {
id: notificationMouseArea
anchors.fill: parent
anchors.rightMargin: 50 * scaling
hoverEnabled: true
// Remove the onClicked handler since we now have a dedicated delete button
}
}
ScrollBar.vertical: ScrollBar {
active: true
anchors.right: parent.right