From 684a41ea38ca10a32a9bd748ae056e0e20fd6a25 Mon Sep 17 00:00:00 2001 From: tr1x_em Date: Sat, 2 Aug 2025 21:43:07 +0530 Subject: [PATCH] Fixed Mistakes by ai --- .gitignore | 1 + modules/notification/notification.py | 48 +++++++++++++++++----------- styles/about.css | 3 +- styles/notification-center.css | 3 +- styles/osd.css | 2 +- styles/panel.css | 5 +-- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 3182e3a..ebb400d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ config/hypr/colors.conf fabric/** fabric/ # styles/colors.css +.aider* diff --git a/modules/notification/notification.py b/modules/notification/notification.py index d4334ba..c8e36ae 100644 --- a/modules/notification/notification.py +++ b/modules/notification/notification.py @@ -86,11 +86,11 @@ class NotificationWidget(Box): self.notification = notification self.timeout_ms = timeout_ms self._timeout_id = None - + # Add hover events to the main notification widget self.connect("enter-notify-event", self._on_enter_notify) self.connect("leave-notify-event", self._on_leave_notify) - + self.start_timeout() def create_header(self, notification): @@ -343,9 +343,9 @@ class NotificationRevealer(SlideRevealer): ): if self._is_closing: return - + self._is_closing = True - + # Use left-to-right slide for auto-dismiss (expired), right-to-left for manual close if reason == "expired": # Left-to-right slide for auto-dismiss @@ -405,7 +405,7 @@ class NotificationState: HIDING = 2 -class NotificationCenter(Window): +class ModusNoti(Window): def __init__(self): self._server = notification_service self.notifications = Box( @@ -466,30 +466,37 @@ class NotificationCenter(Window): # Add new notification to queue self.notification_queue.append(notification) - + # Process the queue self._process_notification_queue() def _process_notification_queue(self): # If we're currently showing a notification and there's a new one in queue - if (self.notification_state == NotificationState.SHOWING and - self.current_notification and - self.notification_queue): - + if ( + self.notification_state == NotificationState.SHOWING + and self.current_notification + and self.notification_queue + ): + # Start hiding the current notification to make room for the new one self._start_hiding_current_notification() - - elif self.notification_state == NotificationState.IDLE and self.notification_queue: + + elif ( + self.notification_state == NotificationState.IDLE + and self.notification_queue + ): # If we're idle and have notifications in queue, show the next one self._show_next_notification() def _start_hiding_current_notification(self): - if (self.current_notification and - self.notification_state == NotificationState.SHOWING and - not self.current_notification._is_closing): - + if ( + self.current_notification + and self.notification_state == NotificationState.SHOWING + and not self.current_notification._is_closing + ): + self.notification_state = NotificationState.HIDING - + # Force close the current notification to trigger hiding animation try: self.current_notification.notification.close("dismissed-by-user") @@ -497,7 +504,10 @@ class NotificationCenter(Window): pass def _show_next_notification(self): - if not self.notification_queue or self.notification_state != NotificationState.IDLE: + if ( + not self.notification_queue + or self.notification_state != NotificationState.IDLE + ): return notification = self.notification_queue.pop(0) @@ -554,7 +564,7 @@ class NotificationCenter(Window): if self.notification_queue: self._transition_timer_id = GLib.timeout_add( 50, # Very short delay for seamless transitions - lambda: self._show_next_notification() or False + lambda: self._show_next_notification() or False, ) def show_next_notification(self): diff --git a/styles/about.css b/styles/about.css index f393619..0f6c718 100644 --- a/styles/about.css +++ b/styles/about.css @@ -1,5 +1,6 @@ #about-menu { - background-color: alpha(#001, 0.3); + background-color: alpha(#000, 0.34); + box-shadow: inset 0 -0.5px 0 .5px alpha(#555, 0.7), inset 0 0.5px 0 .5px alpha(#777, 0.7); border: 1px solid alpha(#111, 0.3); border-top: none; diff --git a/styles/notification-center.css b/styles/notification-center.css index f310ecb..3e19887 100644 --- a/styles/notification-center.css +++ b/styles/notification-center.css @@ -1,5 +1,6 @@ #noti-center-box { - background-color: alpha(#001, 0.3); + background-color: alpha(#fff, 0.09); + border: 1px solid alpha(#111, 0.3); border-radius: 16px; padding: 20px; diff --git a/styles/osd.css b/styles/osd.css index 1a11739..7b13501 100644 --- a/styles/osd.css +++ b/styles/osd.css @@ -1,5 +1,5 @@ #osd { - background-color: alpha(#000, 0.03); + background-color: alpha(#fff, 0.09); padding: 12px 20px; margin: 70px; min-height: 200px; diff --git a/styles/panel.css b/styles/panel.css index ede6560..41b4a35 100644 --- a/styles/panel.css +++ b/styles/panel.css @@ -1,7 +1,8 @@ #panel { - background-color: alpha(#010101, 0.1); + background-color: alpha(#fff, 0.05); + border-bottom: 1px solid alpha(#010101, 0.025); - margin-top: -4; + margin-top: -4px; margin-bottom: -4px; transition: all 120ms ease-in-out; }