This commit is contained in:
2026-03-15 20:08:48 -05:00
parent 9871af127a
commit 6ea4782a80
15 changed files with 610 additions and 491 deletions

View File

@@ -7,137 +7,69 @@ import Quickshell.Io
import Quickshell.Widgets
import Quickshell.Hyprland
Item {
width: 50
height: 30
ColumnLayout {
anchors.fill: parent
id: lay
spacing: 10
required property NotificationServer server
ClippingWrapperRectangle {
id: barbutton
color: Pywal.colors.color11
radius: 5
anchors.fill: parent
Button {
id: button
text: "󰂚"
font.pointSize: 16
onClicked: {
Layout.margins: 5
Layout.alignment: Qt.AlignVCenter | Qt.AlignTop
implicitWidth: lay.width - 2 * Layout.margins
menu.visible = true
grab.active = true
RowLayout {
width: parent.width
Text {
color: Pywal.colors.color0
Layout.margins: 5
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
text: 'Notifications'
}
implicitHeight: parent.height
}
}
Button {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.margins: 5
implicitWidth: 20
implicitHeight: 20
NotificationServer {
id: server
persistenceSupported: true
imageSupported: true
actionsSupported: true
bodyImagesSupported: true
bodySupported: true
bodyHyperlinksSupported: true
inlineReplySupported: true
actionIconsSupported: true
text: 'x'
onNotification: (n) => {
n.tracked = !n.transient
}
}
required property PanelWindow window
id: root
PopupWindow {
id: menu
anchor.window: window
anchor.rect.x: window.width - width
anchor.rect.y: 50
implicitWidth: 400
implicitHeight: 1080 - anchor.rect.y
visible: false
color: "transparent"
ClippingWrapperRectangle {
radius: 5
color: Pywal.special.background
implicitHeight: parent.height - 20
implicitWidth: parent.width
ColumnLayout {
id: lay
spacing: 10
ClippingWrapperRectangle {
color: Pywal.colors.color2
radius: 5
Layout.margins: 5
Layout.alignment: Qt.AlignVCenter | Qt.AlignTop
implicitWidth: menu.width - 2 * Layout.margins
RowLayout {
width: parent.width
Text {
color: Pywal.colors.color0
Layout.margins: 5
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
text: 'Notifications'
}
Button {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.margins: 5
implicitWidth: 20
implicitHeight: 20
text: 'x'
onClicked: {
while(server.trackedNotifications.values.length > 0) {
server.trackedNotifications.values[0].dismiss()
}
}
}
onClicked: {
while(server.trackedNotifications.values.length > 0) {
server.trackedNotifications.values[0].dismiss()
}
}
ColumnLayout {
Layout.alignment: Qt.AlignVCenter | Qt.AlignTop
Repeater {
id: rep
model: server.trackedNotifications.values
Notif {
required property int index
src: rep.model[index]
}
onItemAdded: (idx, it) => {
button.text = '󱅫 ' + rep.count
}
onItemRemoved: (idx, it) => {
button.text = (rep.count - 1) <= 0 ? "󰂚" : '󱅫 ' + (rep.count - 1)
}
}
}
}
}
}
HyprlandFocusGrab {
id: grab
windows: [ menu ]
onCleared: menu.visible = false
ColumnLayout {
width: parent.width
Layout.alignment: Qt.AlignVCenter | Qt.AlignTop
Repeater {
id: rep
model: server.trackedNotifications.values
Notif {
required property int index
src: rep.model[index]
}
onItemAdded: (idx, it) => {
//button.text = '󱅫 ' + rep.count
}
onItemRemoved: (idx, it) => {
//button.text = (rep.count - 1) <= 0 ? "󰂚" : '󱅫 ' + (rep.count - 1)
}
}
}
}