gardesk/garnotify / 78dddba

Browse files

ui: add module with PopupCommand and PopupEvent

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
78dddbabf1c2edfd6bfeb6baeb61f301bb52bb24
Parents
af40f03
Tree
b769a64

1 changed file

StatusFile+-
A garnotify/src/ui/mod.rs 38 0
garnotify/src/ui/mod.rsadded
@@ -0,0 +1,38 @@
1
+//! UI module for notification popup windows
2
+//!
3
+//! Handles X11 window creation, Cairo rendering, and mouse interaction
4
+//! for notification popups.
5
+
6
+mod layout;
7
+mod popup;
8
+mod popup_manager;
9
+
10
+pub use layout::{LayoutManager, NotificationPosition, StackDirection};
11
+pub use popup::NotificationPopup;
12
+pub use popup_manager::PopupManager;
13
+
14
+use crate::notification::{CloseReason, Notification};
15
+
16
+/// Commands that can be sent to the UI system
17
+#[derive(Debug, Clone)]
18
+pub enum PopupCommand {
19
+    /// Show a notification popup
20
+    Show(Notification),
21
+    /// Update an existing notification (replacement)
22
+    Update { id: u32, notification: Notification },
23
+    /// Close a notification popup
24
+    Close { id: u32, reason: CloseReason },
25
+    /// Close all notification popups
26
+    CloseAll,
27
+}
28
+
29
+/// Events generated by the UI system
30
+#[derive(Debug, Clone)]
31
+pub enum PopupEvent {
32
+    /// User clicked to dismiss a notification
33
+    Dismissed(u32),
34
+    /// User clicked an action button
35
+    ActionInvoked { id: u32, action_key: String },
36
+    /// Notification popup was closed (animation finished, etc.)
37
+    Closed { id: u32, reason: CloseReason },
38
+}