mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Notifications: expand link below the body, don't force expand notifications with actions.
This commit is contained in:
@@ -334,7 +334,7 @@ SmartPanel {
|
||||
|
||||
property string notificationId: model.id
|
||||
property bool isExpanded: scrollView.expandedId === notificationId
|
||||
property bool canExpand: summaryText.truncated || bodyText.truncated || (actionsList.length > 0) // Explicitly allow expand if actions exist
|
||||
property bool canExpand: summaryText.truncated || bodyText.truncated
|
||||
|
||||
// Parse actions safely
|
||||
property var actionsList: {
|
||||
@@ -470,31 +470,6 @@ SmartPanel {
|
||||
visible: text.length > 0
|
||||
}
|
||||
|
||||
// Actions Flow
|
||||
Flow {
|
||||
width: parent.width
|
||||
spacing: Style.marginS
|
||||
visible: notificationDelegate.actionsList.length > 0
|
||||
|
||||
Repeater {
|
||||
model: notificationDelegate.actionsList
|
||||
delegate: NButton {
|
||||
text: modelData.text
|
||||
fontSize: Style.fontSizeS
|
||||
backgroundColor: Color.mPrimary
|
||||
textColor: Color.mOnPrimary
|
||||
outlined: false
|
||||
implicitHeight: 24
|
||||
|
||||
// Capture modelData in a property to avoid reference errors
|
||||
property var actionData: modelData
|
||||
onClicked: {
|
||||
NotificationService.invokeAction(notificationDelegate.notificationId, actionData.identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Expand indicator
|
||||
Row {
|
||||
width: parent.width
|
||||
@@ -520,6 +495,31 @@ SmartPanel {
|
||||
color: Color.mPrimary
|
||||
}
|
||||
}
|
||||
|
||||
// Actions Flow
|
||||
Flow {
|
||||
width: parent.width
|
||||
spacing: Style.marginS
|
||||
visible: notificationDelegate.actionsList.length > 0
|
||||
|
||||
Repeater {
|
||||
model: notificationDelegate.actionsList
|
||||
delegate: NButton {
|
||||
text: modelData.text
|
||||
fontSize: Style.fontSizeS
|
||||
backgroundColor: Color.mPrimary
|
||||
textColor: Color.mOnPrimary
|
||||
outlined: false
|
||||
implicitHeight: 24
|
||||
|
||||
// Capture modelData in a property to avoid reference errors
|
||||
property var actionData: modelData
|
||||
onClicked: {
|
||||
NotificationService.invokeAction(notificationDelegate.notificationId, actionData.identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete button
|
||||
|
||||
Reference in New Issue
Block a user