move notif item to its own file
This commit is contained in:
parent
12e1d64660
commit
41b75cffca
2 changed files with 41 additions and 28 deletions
40
modules/bar/components/notifications/NotificationItem.qml
Normal file
40
modules/bar/components/notifications/NotificationItem.qml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
|
||||
StyledLabel {
|
||||
id: root
|
||||
|
||||
required property var modelData
|
||||
|
||||
margin: 16
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
RowLayout {
|
||||
ClippingRectangle {
|
||||
implicitWidth: icon.implicitSize
|
||||
implicitHeight: icon.implicitSize
|
||||
IconImage {
|
||||
id: icon
|
||||
implicitSize: 20
|
||||
source: root.modelData.image == "" ? Quickshell.iconPath(root.modelData.appIcon, "device-support-unknown-symbolic") : root.modelData.image
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
|
||||
StyledText {
|
||||
font.bold: true
|
||||
font.pixelSize: 12
|
||||
text: root.modelData.summary ?? root.modelData.appName
|
||||
}
|
||||
StyledText {
|
||||
text: root.modelData.body
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -61,34 +61,7 @@ StyledPopupWindow {
|
|||
}
|
||||
}
|
||||
model: Notifications.list
|
||||
delegate: StyledLabel {
|
||||
required property var modelData
|
||||
margin: 16
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
RowLayout {
|
||||
ClippingRectangle {
|
||||
implicitWidth: icon.implicitSize
|
||||
implicitHeight: icon.implicitSize
|
||||
IconImage {
|
||||
id: icon
|
||||
implicitSize: 20
|
||||
source: modelData.image == "" ? Quickshell.iconPath(modelData.appIcon, "device-support-unknown-symbolic") : modelData.image
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
|
||||
StyledText {
|
||||
font.bold: true
|
||||
font.pixelSize: 12
|
||||
text: modelData.summary ?? modelData.appName
|
||||
}
|
||||
StyledText {
|
||||
text: modelData.body
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: NotificationItem {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue