Show explicit choices on notification cards
This commit is contained in:
1 parent
35f8eef1bc
commit
036e501e58
4 files changed
+58
-2
No files matched your search
@@ -26,6 +26,7 @@ BorderSurface {
|
||||
property int urgency: 1
|
||||
property double timestamp: 0
|
||||
property int cornerRadius: 0
|
||||
property var actions: []
|
||||
|
||||
// System monospace font injected by the container.
|
||||
property string fontFamily: ""
|
||||
@@ -34,6 +35,7 @@ BorderSurface {
|
||||
|
||||
signal closeRequested()
|
||||
signal cardClicked()
|
||||
signal actionClicked(string identifier)
|
||||
// Prefer per-notification media/avatar data, then fall back to the app icon.
|
||||
// The `check` flag avoids Qt's missing-texture placeholder for unknown names.
|
||||
readonly property string smallIconSource: image.length > 0 ? image : iconSource(appIcon)
|
||||
@@ -193,6 +195,27 @@ BorderSurface {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Style.space(12)
|
||||
Layout.rightMargin: Style.space(12)
|
||||
Layout.bottomMargin: visible ? Style.space(10) : 0
|
||||
visible: root.actions.length > 0
|
||||
spacing: Style.space(8)
|
||||
|
||||
Repeater {
|
||||
model: root.actions
|
||||
delegate: Button {
|
||||
required property var modelData
|
||||
text: modelData.text
|
||||
bordered: true
|
||||
foreground: Color.notifications.text
|
||||
fontFamily: root.fontFamily
|
||||
onClicked: root.actionClicked(modelData.identifier)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hover-revealed close. Stacked after mainColumn so its MouseArea sits
|
||||
|
||||
Reference in new issue
Block a user