Krolyxon
Commit bf9a79c

Branches

Refs →

aurora.configquickshellauroraNotifPage.qml

65 lines · 1.6 KB · QML

1import QtQuick
2import QtQuick.Layouts
3
4ColumnLayout {
5 id: page
6 spacing: 8
7
8 RowLayout {
9 Layout.fillWidth: true
10 spacing: 6
11 Text {
12 Layout.fillWidth: true
13 text: Notifs.count + (Notifs.count === 1 ? " notification" : " notifications")
14 color: Notifs.count > 0 ? Theme.accent : Theme.dim
15 font.family: Theme.font
16 font.pixelSize: Theme.fontSize
17 }
18 IconBtn {
19 icon: Notifs.dnd ? Theme.iBellOff : Theme.iBell
20 label: "dnd"
21 active: Notifs.dnd
22 onClicked: Notifs.dnd = !Notifs.dnd
23 }
24 IconBtn {
25 icon: Theme.iTrash
26 label: "clear"
27 onClicked: Notifs.clearAll()
28 }
29 }
30
31 SectionLabel { text: "history" }
32
33 Text {
34 visible: Notifs.count === 0
35 Layout.alignment: Qt.AlignHCenter
36 Layout.topMargin: 40
37 text: Theme.iBell + " all quiet"
38 color: Theme.dim
39 font.family: Theme.font
40 font.pixelSize: Theme.fontSize + 1
41 }
42
43 Flickable {
44 Layout.fillWidth: true
45 Layout.fillHeight: true
46 clip: true
47 contentWidth: width
48 contentHeight: list.implicitHeight
49 boundsBehavior: Flickable.StopAtBounds
50 id: flick
51
52 ColumnLayout {
53 id: list
54 width: flick.width
55 spacing: 6
56 Repeater {
57 model: { Notifs.count; return Notifs.history() }
58 delegate: NotifCard {
59 required property var modelData
60 n: modelData
61 }
62 }
63 }
64 }
65}