Compare commits
2 commits
51a6323b66
...
1c67f002f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c67f002f4 | ||
|
|
cd99371a89 |
2 changed files with 12 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ Item {
|
||||||
required property var notif // NotifItem (may be null — all accesses use ?.)
|
required property var notif // NotifItem (may be null — all accesses use ?.)
|
||||||
|
|
||||||
property bool showAppName: true
|
property bool showAppName: true
|
||||||
|
property bool dismissOnAction: true
|
||||||
property int iconSize: 32
|
property int iconSize: 32
|
||||||
property int bodyMaxLines: 3
|
property int bodyMaxLines: 3
|
||||||
property color accentColor: M.Theme.base0D
|
property color accentColor: M.Theme.base0D
|
||||||
|
|
@ -24,6 +25,12 @@ Item {
|
||||||
id: _hover
|
id: _hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onTapped: root.dismissRequested()
|
||||||
|
}
|
||||||
|
|
||||||
// Background: base01, base02 on hover
|
// Background: base01, base02 on hover
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -138,6 +145,7 @@ Item {
|
||||||
const def = root.notif?.actions?.find(a => a.identifier === "default");
|
const def = root.notif?.actions?.find(a => a.identifier === "default");
|
||||||
if (def) {
|
if (def) {
|
||||||
def.invoke();
|
def.invoke();
|
||||||
|
if (root.dismissOnAction)
|
||||||
root.dismissRequested();
|
root.dismissRequested();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +265,8 @@ Item {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onTapped: {
|
onTapped: {
|
||||||
parent.modelData.invoke();
|
parent.modelData.invoke();
|
||||||
M.NotifService.dismiss(root.notif.id);
|
if (root.dismissOnAction)
|
||||||
|
root.dismissRequested();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -418,6 +418,7 @@ M.HoverPanel {
|
||||||
anchors.leftMargin: 8
|
anchors.leftMargin: 8
|
||||||
notif: notifDelegate._notif
|
notif: notifDelegate._notif
|
||||||
showAppName: false
|
showAppName: false
|
||||||
|
dismissOnAction: false
|
||||||
iconSize: 24
|
iconSize: 24
|
||||||
bodyMaxLines: 2
|
bodyMaxLines: 2
|
||||||
onDismissRequested: notifDelegate.dismiss()
|
onDismissRequested: notifDelegate.dismiss()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue