From 7598a3eadb9ac172b7e13b9c87ee6dd98c5d5f7e Mon Sep 17 00:00:00 2001 From: tr1x_em Date: Sun, 3 Aug 2025 13:14:41 +0530 Subject: [PATCH] Misc Fixes and CSS --- main.css | 2 +- modules/controlcenter/player.py | 39 +++++++++++++++++---------------- modules/panel/main.py | 2 +- styles/controlcenter.css | 4 +++- styles/launcher.css | 7 +++--- styles/notification-center.css | 5 ++++- styles/notification.css | 6 ++--- 7 files changed, 36 insertions(+), 29 deletions(-) diff --git a/main.css b/main.css index 58cff50..356ab00 100644 --- a/main.css +++ b/main.css @@ -33,7 +33,7 @@ tooltip { border-radius: 16px; border-color: var(--surface); background-color: var(--shadow); - animation: tooltipShow 0.25s cubic-bezier(0.5, 0.25, 0, 1); + /* animation: tooltipShow 0.25s cubic-bezier(0.5, 0.25, 0, 1); */ } @keyframes tooltipShow { diff --git a/modules/controlcenter/player.py b/modules/controlcenter/player.py index 9bea977..9c65c42 100644 --- a/modules/controlcenter/player.py +++ b/modules/controlcenter/player.py @@ -88,7 +88,6 @@ class Player(Box): f"background-image:url('{data.HOME_DIR}/.current.wall')" ) - self.children = [ self.album_cover, Box( @@ -201,9 +200,6 @@ class Player(Box): return self.duration = dur - - - def on_seek(self, sender, ratio): pos = ratio * self.duration # duration in seconds self._player.set_position(int(pos)) @@ -269,7 +265,7 @@ class Player(Box): self._is_updating = True update_func, args, kwargs = self._update_queue.pop(0) - + try: update_func(*args, **kwargs) except Exception as e: @@ -284,13 +280,14 @@ class Player(Box): """Finish current update and process next item in queue.""" self._is_updating = False self._update_timeout_id = None - + if self._update_queue: self._process_queue() return False def _handle_thumbnail(self, metadata, player): """Queue thumbnail update to prevent overlapping operations.""" + def _update_thumbnail(): keys = metadata.keys() player_name = player.props.player_name @@ -305,16 +302,24 @@ class Player(Box): logger.debug(f"Found MPRIS art for {player_name}: {art_url}") # Check for browser players and YouTube URLs - elif player_name in ["firefox", "chromium", "vivaldi", "brave"] and "xesam:url" in keys: + elif ( + player_name in ["firefox", "chromium", "vivaldi", "brave"] + and "xesam:url" in keys + ): webpage_url = metadata["xesam:url"] if webpage_url and "youtube.com" in webpage_url: # Simple YouTube thumbnail extraction import re + match = re.search(r"(?:v=|/)([a-zA-Z0-9_-]{11})", webpage_url) if match: video_id = match.group(1) - new_thumbnail = f"https://img.youtube.com/vi/{video_id}/hqdefault.jpg" - logger.debug(f"Found YouTube thumbnail for {player_name}: {new_thumbnail}") + new_thumbnail = ( + f"https://img.youtube.com/vi/{video_id}/hqdefault.jpg" + ) + logger.debug( + f"Found YouTube thumbnail for {player_name}: {new_thumbnail}" + ) # Only update if thumbnail has changed if new_thumbnail and new_thumbnail != self._current_thumbnail: @@ -324,20 +329,20 @@ class Player(Box): elif not new_thumbnail and self._current_thumbnail: # Reset to default if no thumbnail found self._current_thumbnail = None - self.album_cover.set_style(f"background-image:url('{data.HOME_DIR}/.current.wall')") + self.album_cover.set_style( + f"background-image:url('{data.HOME_DIR}/.current.wall')" + ) logger.debug(f"Reset to default wallpaper for {player_name}") self._queue_update(_update_thumbnail) - - def handle_next(self, player): def _do_next(): try: self._player._player.next() except Exception as e: logger.warning(f"Failed to go to next track: {e}") - + self._queue_update(_do_next) def handle_prev(self, player): @@ -346,11 +351,9 @@ class Player(Box): self._player._player.previous() except Exception as e: logger.warning(f"Failed to go to previous track: {e}") - + self._queue_update(_do_prev) - - def handle_play_pause(self, player): def _do_play_pause(): is_playing = ( @@ -431,9 +434,7 @@ class Placeholder(Box): children=[ CenterBox( name="details", - center_children=Label( - label="Nothing Playing", style="color:black;" - ), + center_children=Label(label="Nothing Playing"), ) ], ), diff --git a/modules/panel/main.py b/modules/panel/main.py index 9bfb111..6f8334a 100644 --- a/modules/panel/main.py +++ b/modules/panel/main.py @@ -41,7 +41,7 @@ class Panel(Window): self.imac = Button( name="panel-button", child=Svg( - size=23, + size=20, svg_file=get_relative_path("../../config/assets/icons/misc/logo.svg"), ), on_clicked=lambda *_: self.menubar.show_system_dropdown(self.imac), diff --git a/styles/controlcenter.css b/styles/controlcenter.css index 728553f..9e20346 100644 --- a/styles/controlcenter.css +++ b/styles/controlcenter.css @@ -5,14 +5,16 @@ margin: 0; } + #control-center-widgets { - background-color: alpha(#000, 0.3); + background-color: alpha(#fff, 0.09); box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4); border: 1px solid alpha(#111, 0.4); border-radius: 1.25rem; padding: 0.5rem; } + /* Widgets */ #wifi-widget, #bluetooth-widget { diff --git a/styles/launcher.css b/styles/launcher.css index 767653c..9b32d41 100644 --- a/styles/launcher.css +++ b/styles/launcher.css @@ -1,13 +1,14 @@ #launcher { - background-color: alpha(#999, 0.3); - color: #000; + background-color: alpha(#000, 0.3); padding: 0; border-radius: 12px; min-width: 640px; border: 1px solid rgba(255, 255, 255, 0.1); - box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); } +#launcher-search{ + color: #000; +} #header_box { padding: 0px 20px 0 20px; color: #000; diff --git a/styles/notification-center.css b/styles/notification-center.css index 3e19887..4bb5106 100644 --- a/styles/notification-center.css +++ b/styles/notification-center.css @@ -14,8 +14,11 @@ margin-top: 10px; } +#noti-clear-button { + background-color: alpha(#888, 0.09); +} #noti-clear-button:hover { - background-color: var(--surface-bright); + background-color: alpha(#fff, 0.09); } /* Stacked notification group styles */ diff --git a/styles/notification.css b/styles/notification.css index 09a7598..55ed6b0 100644 --- a/styles/notification.css +++ b/styles/notification.css @@ -1,6 +1,6 @@ #notification { padding: 16px; - background-color: alpha(#000, 0.3); + background-color: alpha(#fff, 0.03); /* border: 0.5px solid alpha(#111, 0.4); */ /* box-shadow: */ /* inset 0 0 200px 0 alpha(#111, 0.5), */ @@ -15,14 +15,14 @@ } #notification-action-buttons button { - background-color: alpha(#000, 0.3); + background-color: alpha(#999, 0.3); padding: 8px; border-radius: 20px; transition: background-color 0.1s ease; } #notification-action-buttons button:hover { - background-color: var(--surface-bright); + background-color: alpha(#000, 0.3); } #notification-action-buttons button:active {