Merge branch 'main' of github.com:noctalia-dev/noctalia-shell
This commit is contained in:
commit
f06d0f4e1e
2 changed files with 133 additions and 68 deletions
|
|
@ -93,7 +93,10 @@ Variants {
|
||||||
model: notificationModel
|
model: notificationModel
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
width: 360 * scaling
|
width: 360 * scaling
|
||||||
height: Math.max(80 * scaling, contentRow.implicitHeight + (Style.marginL * 2 * scaling))
|
height: Math.max(
|
||||||
|
80 * scaling,
|
||||||
|
contentRow.implicitHeight + (actionsRow.visible ? actionsRow.implicitHeight + Style.marginM
|
||||||
|
* scaling : 0) + (Style.marginL * 2 * scaling))
|
||||||
clip: true
|
clip: true
|
||||||
radius: Style.radiusL * scaling
|
radius: Style.radiusL * scaling
|
||||||
border.color: Color.mOutline
|
border.color: Color.mOutline
|
||||||
|
|
@ -156,12 +159,16 @@ Variants {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
id: contentRow
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.marginM * scaling
|
anchors.margins: Style.marginM * scaling
|
||||||
spacing: Style.marginM * scaling
|
spacing: Style.marginM * scaling
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: contentRow
|
||||||
|
spacing: Style.marginM * scaling
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
// Right: header on top, then avatar + texts
|
// Right: header on top, then avatar + texts
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: textColumn
|
id: textColumn
|
||||||
|
|
@ -240,8 +247,60 @@ Variants {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actions removed
|
// Notification actions - positioned below the main content
|
||||||
|
RowLayout {
|
||||||
|
id: actionsRow
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: Style.marginS * scaling
|
||||||
|
visible: model.rawNotification && model.rawNotification.actions
|
||||||
|
&& model.rawNotification.actions.length > 0
|
||||||
|
|
||||||
|
property var notificationActions: model.rawNotification ? model.rawNotification.actions : []
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.log("Actions row created, rawNotification:", model.rawNotification)
|
||||||
|
if (model.rawNotification) {
|
||||||
|
console.log("Actions:", model.rawNotification.actions)
|
||||||
|
console.log("Actions length:",
|
||||||
|
model.rawNotification.actions ? model.rawNotification.actions.length : "null")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: actionsRow.notificationActions
|
||||||
|
|
||||||
|
delegate: NButton {
|
||||||
|
text: {
|
||||||
|
var actionText = modelData.text || "Action"
|
||||||
|
// If text contains comma, take the part after the comma (the display text)
|
||||||
|
if (actionText.includes(",")) {
|
||||||
|
return actionText.split(",")[1] || actionText
|
||||||
|
}
|
||||||
|
return actionText
|
||||||
|
}
|
||||||
|
fontSize: Style.fontSizeS * scaling
|
||||||
|
backgroundColor: Color.mPrimary
|
||||||
|
textColor: Color.mOnPrimary
|
||||||
|
hoverColor: Color.mSecondary
|
||||||
|
pressColor: Color.mTertiary
|
||||||
|
outlined: false
|
||||||
|
customHeight: 32 * scaling
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.log("Action button created:", modelData.text, "Display text:", text)
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
console.log("Action clicked:", modelData.text)
|
||||||
|
if (modelData && modelData.invoke) {
|
||||||
|
modelData.invoke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NIconButton {
|
NIconButton {
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,10 @@ The launcher supports special commands for enhanced functionality:
|
||||||
For Niri:
|
For Niri:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
debug {
|
||||||
|
honor-xdg-activation-with-invalid-serial
|
||||||
|
}
|
||||||
|
|
||||||
window-rule {
|
window-rule {
|
||||||
geometry-corner-radius 20
|
geometry-corner-radius 20
|
||||||
clip-to-geometry true
|
clip-to-geometry true
|
||||||
|
|
@ -279,6 +283,8 @@ layer-rule {
|
||||||
place-within-backdrop true
|
place-within-backdrop true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
`honor-xdg-activation-with-invalid-serial` allows notification actions (like view etc) to work.
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue