notifs: actual list
This commit is contained in:
parent
6b64c8a918
commit
8c2bda4cff
4 changed files with 72 additions and 8 deletions
|
|
@ -3,22 +3,85 @@ import "root:/services"
|
|||
import "root:/config"
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Column {
|
||||
Item {
|
||||
id: root
|
||||
|
||||
padding: Appearance.padding.large
|
||||
readonly property int padding: Appearance.padding.large
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
|
||||
spacing: Appearance.spacing.normal
|
||||
implicitWidth: NotifsConfig.sizes.width + root.padding * 2
|
||||
implicitHeight: list.height + root.padding * 2
|
||||
|
||||
ListView {
|
||||
id: list
|
||||
|
||||
Repeater {
|
||||
model: ScriptModel {
|
||||
values: [...Notifs.list]
|
||||
values: [...Notifs.popups].reverse()
|
||||
}
|
||||
|
||||
Notification {}
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: root.padding
|
||||
|
||||
clip: true
|
||||
implicitHeight: {
|
||||
let height = (count - 1) * spacing;
|
||||
for (let i = 0; i < count; i++)
|
||||
height += itemAtIndex(i).height;
|
||||
return height;
|
||||
}
|
||||
|
||||
orientation: Qt.Vertical
|
||||
spacing: Appearance.spacing.smaller
|
||||
|
||||
delegate: Notification {}
|
||||
|
||||
ScrollBar.vertical: StyledScrollBar {}
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
property: "x"
|
||||
from: NotifsConfig.sizes.width
|
||||
to: 0
|
||||
duration: Appearance.anim.durations.large
|
||||
easing.bezierCurve: Appearance.anim.curves.emphasizedDecel
|
||||
}
|
||||
}
|
||||
|
||||
remove: Transition {
|
||||
Anim {
|
||||
property: "x"
|
||||
from: 0
|
||||
to: NotifsConfig.sizes.width
|
||||
easing.bezierCurve: Appearance.anim.curves.emphasizedAccel
|
||||
}
|
||||
}
|
||||
|
||||
move: Transition {
|
||||
Anim {
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
|
||||
displaced: Transition {
|
||||
Anim {
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
duration: Appearance.anim.durations.normal
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: Appearance.anim.curves.standard
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Variants {
|
|||
id: root
|
||||
|
||||
required property ShellScreen modelData
|
||||
property bool osdVisible: Notifs.list.length > 0
|
||||
property bool osdVisible: Notifs.popups.length > 0
|
||||
|
||||
LazyLoader {
|
||||
loading: true
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Item {
|
|||
property: "height"
|
||||
duration: Appearance.anim.durations.normal
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: Appearance.anim.curves.emphasizedAccel
|
||||
easing.bezierCurve: Appearance.anim.curves.standard
|
||||
}
|
||||
PropertyAction {
|
||||
target: root
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Singleton {
|
|||
id: root
|
||||
|
||||
readonly property list<Notif> list: []
|
||||
readonly property list<Notif> popups: list.filter(n => n.popup)
|
||||
|
||||
NotificationServer {
|
||||
id: server
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue