Misc Fixes and CSS
This commit is contained in:
1 parent
5a587e7e10
commit
7598a3eadb
7 files changed
+36
-29
No files matched your search
@@ -33,7 +33,7 @@ tooltip {
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
border-color: var(--surface);
|
border-color: var(--surface);
|
||||||
background-color: var(--shadow);
|
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 {
|
@keyframes tooltipShow {
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ class Player(Box):
|
|||||||
f"background-image:url('{data.HOME_DIR}/.current.wall')"
|
f"background-image:url('{data.HOME_DIR}/.current.wall')"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
self.children = [
|
self.children = [
|
||||||
self.album_cover,
|
self.album_cover,
|
||||||
Box(
|
Box(
|
||||||
@@ -201,9 +200,6 @@ class Player(Box):
|
|||||||
return
|
return
|
||||||
self.duration = dur
|
self.duration = dur
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_seek(self, sender, ratio):
|
def on_seek(self, sender, ratio):
|
||||||
pos = ratio * self.duration # duration in seconds
|
pos = ratio * self.duration # duration in seconds
|
||||||
self._player.set_position(int(pos))
|
self._player.set_position(int(pos))
|
||||||
@@ -269,7 +265,7 @@ class Player(Box):
|
|||||||
|
|
||||||
self._is_updating = True
|
self._is_updating = True
|
||||||
update_func, args, kwargs = self._update_queue.pop(0)
|
update_func, args, kwargs = self._update_queue.pop(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
update_func(*args, **kwargs)
|
update_func(*args, **kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -284,13 +280,14 @@ class Player(Box):
|
|||||||
"""Finish current update and process next item in queue."""
|
"""Finish current update and process next item in queue."""
|
||||||
self._is_updating = False
|
self._is_updating = False
|
||||||
self._update_timeout_id = None
|
self._update_timeout_id = None
|
||||||
|
|
||||||
if self._update_queue:
|
if self._update_queue:
|
||||||
self._process_queue()
|
self._process_queue()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _handle_thumbnail(self, metadata, player):
|
def _handle_thumbnail(self, metadata, player):
|
||||||
"""Queue thumbnail update to prevent overlapping operations."""
|
"""Queue thumbnail update to prevent overlapping operations."""
|
||||||
|
|
||||||
def _update_thumbnail():
|
def _update_thumbnail():
|
||||||
keys = metadata.keys()
|
keys = metadata.keys()
|
||||||
player_name = player.props.player_name
|
player_name = player.props.player_name
|
||||||
@@ -305,16 +302,24 @@ class Player(Box):
|
|||||||
logger.debug(f"Found MPRIS art for {player_name}: {art_url}")
|
logger.debug(f"Found MPRIS art for {player_name}: {art_url}")
|
||||||
|
|
||||||
# Check for browser players and YouTube URLs
|
# 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"]
|
webpage_url = metadata["xesam:url"]
|
||||||
if webpage_url and "youtube.com" in webpage_url:
|
if webpage_url and "youtube.com" in webpage_url:
|
||||||
# Simple YouTube thumbnail extraction
|
# Simple YouTube thumbnail extraction
|
||||||
import re
|
import re
|
||||||
|
|
||||||
match = re.search(r"(?:v=|/)([a-zA-Z0-9_-]{11})", webpage_url)
|
match = re.search(r"(?:v=|/)([a-zA-Z0-9_-]{11})", webpage_url)
|
||||||
if match:
|
if match:
|
||||||
video_id = match.group(1)
|
video_id = match.group(1)
|
||||||
new_thumbnail = f"https://img.youtube.com/vi/{video_id}/hqdefault.jpg"
|
new_thumbnail = (
|
||||||
logger.debug(f"Found YouTube thumbnail for {player_name}: {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
|
# Only update if thumbnail has changed
|
||||||
if new_thumbnail and new_thumbnail != self._current_thumbnail:
|
if new_thumbnail and new_thumbnail != self._current_thumbnail:
|
||||||
@@ -324,20 +329,20 @@ class Player(Box):
|
|||||||
elif not new_thumbnail and self._current_thumbnail:
|
elif not new_thumbnail and self._current_thumbnail:
|
||||||
# Reset to default if no thumbnail found
|
# Reset to default if no thumbnail found
|
||||||
self._current_thumbnail = None
|
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}")
|
logger.debug(f"Reset to default wallpaper for {player_name}")
|
||||||
|
|
||||||
self._queue_update(_update_thumbnail)
|
self._queue_update(_update_thumbnail)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def handle_next(self, player):
|
def handle_next(self, player):
|
||||||
def _do_next():
|
def _do_next():
|
||||||
try:
|
try:
|
||||||
self._player._player.next()
|
self._player._player.next()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Failed to go to next track: {e}")
|
logger.warning(f"Failed to go to next track: {e}")
|
||||||
|
|
||||||
self._queue_update(_do_next)
|
self._queue_update(_do_next)
|
||||||
|
|
||||||
def handle_prev(self, player):
|
def handle_prev(self, player):
|
||||||
@@ -346,11 +351,9 @@ class Player(Box):
|
|||||||
self._player._player.previous()
|
self._player._player.previous()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Failed to go to previous track: {e}")
|
logger.warning(f"Failed to go to previous track: {e}")
|
||||||
|
|
||||||
self._queue_update(_do_prev)
|
self._queue_update(_do_prev)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def handle_play_pause(self, player):
|
def handle_play_pause(self, player):
|
||||||
def _do_play_pause():
|
def _do_play_pause():
|
||||||
is_playing = (
|
is_playing = (
|
||||||
@@ -431,9 +434,7 @@ class Placeholder(Box):
|
|||||||
children=[
|
children=[
|
||||||
CenterBox(
|
CenterBox(
|
||||||
name="details",
|
name="details",
|
||||||
center_children=Label(
|
center_children=Label(label="Nothing Playing"),
|
||||||
label="Nothing Playing", style="color:black;"
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Panel(Window):
|
|||||||
self.imac = Button(
|
self.imac = Button(
|
||||||
name="panel-button",
|
name="panel-button",
|
||||||
child=Svg(
|
child=Svg(
|
||||||
size=23,
|
size=20,
|
||||||
svg_file=get_relative_path("../../config/assets/icons/misc/logo.svg"),
|
svg_file=get_relative_path("../../config/assets/icons/misc/logo.svg"),
|
||||||
),
|
),
|
||||||
on_clicked=lambda *_: self.menubar.show_system_dropdown(self.imac),
|
on_clicked=lambda *_: self.menubar.show_system_dropdown(self.imac),
|
||||||
|
|||||||
@@ -5,14 +5,16 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#control-center-widgets {
|
#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);
|
box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4);
|
||||||
border: 1px solid alpha(#111, 0.4);
|
border: 1px solid alpha(#111, 0.4);
|
||||||
border-radius: 1.25rem;
|
border-radius: 1.25rem;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Widgets */
|
/* Widgets */
|
||||||
#wifi-widget,
|
#wifi-widget,
|
||||||
#bluetooth-widget {
|
#bluetooth-widget {
|
||||||
|
|||||||
+4
-3
@@ -1,13 +1,14 @@
|
|||||||
#launcher {
|
#launcher {
|
||||||
background-color: alpha(#999, 0.3);
|
background-color: alpha(#000, 0.3);
|
||||||
color: #000;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
min-width: 640px;
|
min-width: 640px;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
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 {
|
#header_box {
|
||||||
padding: 0px 20px 0 20px;
|
padding: 0px 20px 0 20px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|||||||
@@ -14,8 +14,11 @@
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#noti-clear-button {
|
||||||
|
background-color: alpha(#888, 0.09);
|
||||||
|
}
|
||||||
#noti-clear-button:hover {
|
#noti-clear-button:hover {
|
||||||
background-color: var(--surface-bright);
|
background-color: alpha(#fff, 0.09);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stacked notification group styles */
|
/* Stacked notification group styles */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#notification {
|
#notification {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
background-color: alpha(#000, 0.3);
|
background-color: alpha(#fff, 0.03);
|
||||||
/* border: 0.5px solid alpha(#111, 0.4); */
|
/* border: 0.5px solid alpha(#111, 0.4); */
|
||||||
/* box-shadow: */
|
/* box-shadow: */
|
||||||
/* inset 0 0 200px 0 alpha(#111, 0.5), */
|
/* inset 0 0 200px 0 alpha(#111, 0.5), */
|
||||||
@@ -15,14 +15,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#notification-action-buttons button {
|
#notification-action-buttons button {
|
||||||
background-color: alpha(#000, 0.3);
|
background-color: alpha(#999, 0.3);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
transition: background-color 0.1s ease;
|
transition: background-color 0.1s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification-action-buttons button:hover {
|
#notification-action-buttons button:hover {
|
||||||
background-color: var(--surface-bright);
|
background-color: alpha(#000, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification-action-buttons button:active {
|
#notification-action-buttons button:active {
|
||||||
|
|||||||
Reference in new issue
Block a user