Fix No Media
This commit is contained in:
1 parent
7d169ce1ef
commit
209df5d91a
2 files changed
+50
-20
No files matched your search
@@ -150,7 +150,7 @@ class PlayerBoxStack(Box):
|
|||||||
|
|
||||||
track_artist = Label(
|
track_artist = Label(
|
||||||
label="",
|
label="",
|
||||||
name="player-artist",
|
name="player-artist-c",
|
||||||
justification="left",
|
justification="left",
|
||||||
max_chars_width=15,
|
max_chars_width=15,
|
||||||
ellipsization="end",
|
ellipsization="end",
|
||||||
@@ -161,6 +161,7 @@ class PlayerBoxStack(Box):
|
|||||||
track_info = Box(
|
track_info = Box(
|
||||||
name="track-info",
|
name="track-info",
|
||||||
# spacing=5,
|
# spacing=5,
|
||||||
|
h_expand=True,
|
||||||
orientation="v",
|
orientation="v",
|
||||||
v_align="start",
|
v_align="start",
|
||||||
h_align="start",
|
h_align="start",
|
||||||
@@ -174,38 +175,54 @@ class PlayerBoxStack(Box):
|
|||||||
)
|
)
|
||||||
|
|
||||||
player_info_box = Box(
|
player_info_box = Box(
|
||||||
name="player-info-box",
|
name="player-info-box-c",
|
||||||
|
h_expand=True,
|
||||||
v_align="center",
|
v_align="center",
|
||||||
h_align="start",
|
h_align="center",
|
||||||
orientation="v",
|
orientation="v",
|
||||||
children=[track_info, controls_box],
|
children=[track_info, controls_box],
|
||||||
)
|
)
|
||||||
|
|
||||||
inner_box = Box(
|
inner_box = Box(
|
||||||
name="inner-player-box",
|
name="inner-player-box",
|
||||||
|
h_expand=True,
|
||||||
v_align="center",
|
v_align="center",
|
||||||
h_align="start",
|
h_align="start",
|
||||||
)
|
children=[
|
||||||
|
|
||||||
outer_box = Box(
|
|
||||||
name="outer-player-box",
|
|
||||||
h_align="start",
|
|
||||||
)
|
|
||||||
|
|
||||||
overlay_box = Overlay(
|
|
||||||
child=outer_box,
|
|
||||||
overlays=[
|
|
||||||
inner_box,
|
|
||||||
player_info_box,
|
|
||||||
image_stack,
|
image_stack,
|
||||||
|
player_info_box,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
# resize the inner box
|
||||||
|
outer_box = Box(
|
||||||
|
spacing=5,
|
||||||
|
name="outer-no-player-box-c",
|
||||||
|
h_expand=True,
|
||||||
|
h_align="fill",
|
||||||
|
# children=[
|
||||||
|
v_expand=True,
|
||||||
|
children=inner_box,
|
||||||
|
# inner_box,
|
||||||
|
# player_info_box,
|
||||||
|
# image,
|
||||||
|
# ],
|
||||||
|
)
|
||||||
|
|
||||||
|
box = Box(
|
||||||
|
name="box-c",
|
||||||
|
orientation="h",
|
||||||
|
v_expand=True,
|
||||||
|
h_align="fill",
|
||||||
|
h_expand=True,
|
||||||
|
children=[
|
||||||
|
outer_box,
|
||||||
|
],
|
||||||
|
)
|
||||||
no_media_box = Box(
|
no_media_box = Box(
|
||||||
h_align="center",
|
h_align="center",
|
||||||
name="player-box",
|
name="player-box",
|
||||||
h_expand=True,
|
h_expand=True,
|
||||||
children=[overlay_box],
|
children=[box],
|
||||||
)
|
)
|
||||||
|
|
||||||
return no_media_box
|
return no_media_box
|
||||||
@@ -588,10 +605,10 @@ class PlayerBox(Box):
|
|||||||
self.play_pause_button,
|
self.play_pause_button,
|
||||||
self.next_button,
|
self.next_button,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Assign button_box to controls_box for compatibility
|
# Assign button_box to controls_box for compatibility
|
||||||
self.controls_box = self.button_box
|
self.controls_box = self.button_box
|
||||||
|
|
||||||
self.player_info_box = Box(
|
self.player_info_box = Box(
|
||||||
name="player-info-box-c",
|
name="player-info-box-c",
|
||||||
v_align="center",
|
v_align="center",
|
||||||
@@ -687,7 +704,9 @@ class PlayerBox(Box):
|
|||||||
"""Handle prev button click: open expanded player in control center"""
|
"""Handle prev button click: open expanded player in control center"""
|
||||||
try:
|
try:
|
||||||
# Open expanded player in control center instead of new window
|
# Open expanded player in control center instead of new window
|
||||||
if self.control_center and hasattr(self.control_center, "open_expanded_player"):
|
if self.control_center and hasattr(
|
||||||
|
self.control_center, "open_expanded_player"
|
||||||
|
):
|
||||||
self.control_center.open_expanded_player()
|
self.control_center.open_expanded_player()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Failed to handle prev button click: {e}")
|
logger.warning(f"Failed to handle prev button click: {e}")
|
||||||
@@ -696,11 +715,14 @@ class PlayerBox(Box):
|
|||||||
"""Handle outer box click with proper error handling."""
|
"""Handle outer box click with proper error handling."""
|
||||||
try:
|
try:
|
||||||
# Open expanded player in control center instead of new window
|
# Open expanded player in control center instead of new window
|
||||||
if self.control_center and hasattr(self.control_center, "open_expanded_player"):
|
if self.control_center and hasattr(
|
||||||
|
self.control_center, "open_expanded_player"
|
||||||
|
):
|
||||||
self.control_center.open_expanded_player()
|
self.control_center.open_expanded_player()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Failed to handle outer box click: {e}")
|
logger.warning(f"Failed to handle outer box click: {e}")
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
logger.error(f"Full traceback: {traceback.format_exc()}")
|
logger.error(f"Full traceback: {traceback.format_exc()}")
|
||||||
|
|
||||||
def update_buttons(self, player_buttons, show_buttons):
|
def update_buttons(self, player_buttons, show_buttons):
|
||||||
|
|||||||
@@ -38,6 +38,14 @@
|
|||||||
/* background-color: alpha(#000, 0.3); */
|
/* background-color: alpha(#000, 0.3); */
|
||||||
/* box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4); */
|
/* box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4); */
|
||||||
}
|
}
|
||||||
|
#outer-no-player-box-c {
|
||||||
|
min-height: 55px;
|
||||||
|
min-width: 280px;
|
||||||
|
border-radius: 8px;
|
||||||
|
/* margin: 0 6px; */
|
||||||
|
/* background-color: alpha(#000, 0.3); */
|
||||||
|
/* box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4); */
|
||||||
|
}
|
||||||
#box-c {
|
#box-c {
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
|
|||||||
Reference in new issue
Block a user