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
|
||||
|
||||
@@ -46,7 +46,7 @@ gdbus call --session \
|
||||
0 \
|
||||
"dialog-question" \
|
||||
"Confirmation Required" \
|
||||
"Do you want to proceed with the action?" \
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Do you want to proceed with the action? " \
|
||||
"['default', 'OK', 'cancel', 'Cancel', 'maybe', 'Maybe', 'undecided', 'Undecided']" \
|
||||
"{}" \
|
||||
5000
|
||||
|
||||
Reference in New Issue
Block a user