notif actions

This commit is contained in:
end-4
2025-04-19 22:37:14 +02:00
parent 3677873a05
commit 17289cef29
@@ -19,8 +19,7 @@ Item {
Layout.fillWidth: true
clip: true
// implicitHeight: notificationRowLayout.implicitHeight
implicitHeight: ready ? notificationRowLayout.implicitHeight + notificationListSpacing : 0
implicitHeight: ready ? notificationColumnLayout.implicitHeight + notificationListSpacing : 0
Behavior on implicitHeight {
enabled: enableAnimation
NumberAnimation {
@@ -75,14 +74,17 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
implicitHeight: notificationRowLayout.implicitHeight + notificationListSpacing
implicitHeight: notificationColumnLayout.implicitHeight + notificationListSpacing
ColumnLayout {
id: notificationColumnLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
RowLayout {
id: notificationRowLayout
anchors.left: parent.left
anchors.right: parent.right
// anchors.top: parent.top
anchors.bottom: parent.bottom
Layout.fillWidth: true
Rectangle { // App icon
id: iconRectangle
implicitWidth: 47
@@ -207,18 +209,25 @@ Item {
// textFormat: Text.MarkdownText
text: notificationObject.body
}
}
}
// Actions
Flickable {
id: actionsFlickable
Layout.fillWidth: true
Layout.topMargin: -5
Layout.leftMargin: 10
Layout.rightMargin: 10
Layout.bottomMargin: 10
visible: expanded
implicitHeight: actionRowLayout.implicitHeight
contentWidth: actionRowLayout.implicitWidth
clip: true
RowLayout { // Actions
visible: expanded
RowLayout {
id: actionRowLayout
Repeater {
@@ -238,6 +247,8 @@ Item {
Layout.fillWidth: true
buttonText: "Close"
urgency: notificationObject.urgency
implicitWidth: (notificationObject.actions.length == 0) ? (actionsFlickable.width) :
(contentItem.implicitWidth + leftPadding + rightPadding)
onClicked: {
Notifications.discardNotification(notificationObject.id);
}
@@ -247,5 +258,4 @@ Item {
}
}
}
}
}