Notification backend usable
This commit is contained in:
@@ -1,42 +1,41 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
import Quickshell.Widgets
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import QtQuick.Window
|
||||
|
||||
PopupWindow {
|
||||
|
||||
anchor.item:root
|
||||
anchor.rect.y: parentWindow.height
|
||||
implicitWidth: 400
|
||||
implicitHeight: 1000
|
||||
color: "white"
|
||||
visible:true
|
||||
|
||||
id: notificationRoot
|
||||
|
||||
// Since the panel's screen is unset, it will be picked by the compositor
|
||||
// when the window is created. Most compositors pick the current active monitor.
|
||||
|
||||
|
||||
// An empty click mask prevents the window from blocking mouse events.
|
||||
Component {
|
||||
id: contactDelegate
|
||||
NotificationPopup {
|
||||
id: myItem
|
||||
required property string notification
|
||||
}
|
||||
}
|
||||
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
|
||||
delegate: contactDelegate
|
||||
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
|
||||
focus: true
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user