Misc Fixes and CSS

This commit is contained in:
tr1x_em committed 2025-08-03 13:14:41 +05:30
1 parent 5a587e7e10
commit 7598a3eadb
7 files changed
+36 -29

No files matched your search

+1 -1
View File
@@ -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 {
+20 -19
View File
@@ -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"),
)
],
),
+1 -1
View File
@@ -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),
+3 -1
View File
@@ -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 {
+4 -3
View File
@@ -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;
+4 -1
View File
@@ -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 */
+3 -3
View File
@@ -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 {