summaryrefslogtreecommitdiff
path: root/modules/notifications/Notifications.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-08 20:58:18 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-08 20:58:18 +1000
commita1ed341639fd73ce916eecfce480b14cd8660999 (patch)
treeb8d12c8f03057246e17a360f69bd83a61465e9bd /modules/notifications/Notifications.qml
parentrefactor: split drawers (diff)
downloadcaelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.tar.gz
caelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.tar.bz2
caelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.zip
feat: notification popup area
Diffstat (limited to 'modules/notifications/Notifications.qml')
-rw-r--r--modules/notifications/Notifications.qml79
1 files changed, 79 insertions, 0 deletions
diff --git a/modules/notifications/Notifications.qml b/modules/notifications/Notifications.qml
new file mode 100644
index 0000000..9496a7f
--- /dev/null
+++ b/modules/notifications/Notifications.qml
@@ -0,0 +1,79 @@
+import "root:/widgets"
+import "root:/services"
+import "root:/config"
+import Quickshell
+import Quickshell.Wayland
+import QtQuick
+
+Variants {
+ model: Quickshell.screens
+
+ Scope {
+ id: root
+
+ required property ShellScreen modelData
+ property bool osdVisible
+
+ Timer {
+ running: true
+ repeat: true
+ interval: 2000
+ onTriggered: root.osdVisible = !root.osdVisible
+ }
+
+ LazyLoader {
+ loading: true
+
+ StyledWindow {
+ id: win
+
+ screen: root.modelData
+ name: "notifications"
+ visible: wrapper.shouldBeVisible
+ exclusionMode: ExclusionMode.Normal
+
+ mask: Region {
+ item: wrapper
+ }
+
+ anchors.top: true
+ anchors.bottom: true
+ anchors.right: true
+ width: wrapper.width
+ height: wrapper.height
+
+ Background {
+ id: bg
+
+ visible: false
+
+ anchors.top: parent.top
+ anchors.right: parent.right
+
+ wrapperWidth: wrapper.width
+ wrapperHeight: Math.min(wrapper.height, content.height)
+ }
+
+ LayerShadow {
+ source: bg
+ }
+
+ Wrapper {
+ id: wrapper
+
+ anchors.top: parent.top
+ anchors.right: parent.right
+
+ implicitWidth: content.width + bg.rounding
+
+ osdVisible: root.osdVisible
+ contentHeight: content.height
+
+ Content {
+ id: content
+ }
+ }
+ }
+ }
+ }
+}