Added a clear all notifications button and an AGENTS.md file for llms to
test their effectiveness
This commit is contained in:
@@ -5,80 +5,93 @@ import Quickshell.Wayland
|
||||
import Quickshell.Services.Notifications
|
||||
import qs
|
||||
import qs.common
|
||||
import qs.common.widgets
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
property bool visible: false
|
||||
property int panelWidth: 350
|
||||
id: root
|
||||
property bool visible: false
|
||||
property int panelWidth: 350
|
||||
|
||||
Timer {
|
||||
id: hideTimer
|
||||
interval: Config.options.osd.timeout
|
||||
onTriggered: GlobalStates.notificationPanelOpen = false
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: notificationPanelLoader
|
||||
active: GlobalStates.notificationPanelOpen
|
||||
onActiveChanged: {
|
||||
if (notificationPanelLoader.active) {
|
||||
hideTimer.restart();
|
||||
}
|
||||
Timer {
|
||||
id: hideTimer
|
||||
interval: Config.options.osd.timeout
|
||||
onTriggered: GlobalStates.notificationPanelOpen = false
|
||||
}
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
id: notificationPanelRoot
|
||||
visible: true
|
||||
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
exclusiveZone: 0
|
||||
|
||||
implicitWidth: root.panelWidth
|
||||
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
margins {
|
||||
top: Config.options.bar.height
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0
|
||||
}
|
||||
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: notificationArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onExited: () => {
|
||||
hideTimer.restart();
|
||||
}
|
||||
onEntered: () => {
|
||||
hideTimer.stop();
|
||||
}
|
||||
ColumnLayout {
|
||||
id: notifs
|
||||
anchors.margins: 4
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Repeater {
|
||||
model: NotificationService.notifications
|
||||
NotificationItem {
|
||||
required property Notification modelData
|
||||
notif: modelData
|
||||
textWidth: root.panelWidth - 14
|
||||
notificationRounding: Appearance.rounding.unsharpenmore
|
||||
Loader {
|
||||
id: notificationPanelLoader
|
||||
active: GlobalStates.notificationPanelOpen
|
||||
onActiveChanged: {
|
||||
if (notificationPanelLoader.active) {
|
||||
hideTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
id: notificationPanelRoot
|
||||
visible: true
|
||||
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
exclusiveZone: 0
|
||||
|
||||
implicitWidth: root.panelWidth
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
margins {
|
||||
top: Config.options.bar.height
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0
|
||||
}
|
||||
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: notificationArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onExited: () => {
|
||||
hideTimer.restart();
|
||||
}
|
||||
onEntered: () => {
|
||||
hideTimer.stop();
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: notifs
|
||||
anchors.margins: 4
|
||||
Layout.fillWidth: true
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
visible: NotificationService.amountNotifications > 0
|
||||
|
||||
// Dismiss All Button
|
||||
RippleButton {
|
||||
buttonText: "Dismiss All"
|
||||
buttonTextColor: Appearance.m3colors.m3onTertiaryContainer
|
||||
colBackground: Appearance.m3colors.m3tertiaryContainer
|
||||
releaseAction: NotificationService.dismissAll
|
||||
buttonRadius: Appearance.rounding.unsharpenmore
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: NotificationService.notifications
|
||||
NotificationItem {
|
||||
required property Notification modelData
|
||||
notif: modelData
|
||||
textWidth: root.panelWidth - 14
|
||||
notificationRounding: Appearance.rounding.unsharpenmore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user