42 lines
1.0 KiB
QML
42 lines
1.0 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import qs.Services
|
|
import qs.Widgets
|
|
import QtQuick.Window
|
|
|
|
PopupWindow {
|
|
id: notificationRoot
|
|
|
|
anchor.item: root
|
|
anchor.rect.y: parentWindow?.height
|
|
implicitWidth: 400
|
|
implicitHeight: Math.min(listView.contentHeight, 900)
|
|
color: "white"
|
|
visible: true
|
|
|
|
ListView {
|
|
id: listView
|
|
anchors.fill: parent
|
|
model: NotificationService.trackedNotifications.values
|
|
orientation: ListView.Vertical
|
|
verticalLayoutDirection: ListView.BottomToTop
|
|
clip: true
|
|
spacing: 5
|
|
|
|
delegate: NotificationWrapper {
|
|
required property var modelData
|
|
notification: modelData
|
|
width: ListView.width
|
|
onDismissed: {
|
|
if (notification && typeof notification.dismiss === "function") {
|
|
notification.dismiss();
|
|
}
|
|
}
|
|
}
|
|
Component.onCompleted: positionViewAtEnd()
|
|
onModelChanged: positionViewAtEnd()
|
|
}
|
|
}
|