fire default action on notification text click
This commit is contained in:
parent
76ccc99e17
commit
a2966f51ab
1 changed files with 91 additions and 66 deletions
|
|
@ -125,6 +125,29 @@ Item {
|
|||
anchors.topMargin: 8
|
||||
spacing: 2
|
||||
|
||||
// Text section — tappable for default action
|
||||
Item {
|
||||
id: _textSection
|
||||
width: parent.width
|
||||
height: _textCol.implicitHeight
|
||||
implicitHeight: _textCol.implicitHeight
|
||||
|
||||
TapHandler {
|
||||
cursorShape: root.notif?.actions?.some(a => a.identifier === "default") ? Qt.PointingHandCursor : undefined
|
||||
onTapped: {
|
||||
const def = root.notif?.actions?.find(a => a.identifier === "default");
|
||||
if (def) {
|
||||
def.invoke();
|
||||
root.dismissRequested();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: _textCol
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
|
||||
// App name + time row (optional)
|
||||
Row {
|
||||
visible: root.showAppName
|
||||
|
|
@ -197,6 +220,8 @@ Item {
|
|||
maximumLineCount: root.bodyMaxLines
|
||||
visible: text !== ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Action buttons — filter "default" (click-notification convention) and empty labels
|
||||
Row {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue