style(music): de-duplicate drawer transport controls, let playlist fill drawer height
CI / check (push) Successful in 2m43s
CI / check (push) Successful in 2m43s
The playlist drawer duplicated the player bar's |prev/play/next| transport row even though the drawer can only be open while the bar is visible (drawer_open gates on show_player_bar), so the drawer copy is removed; seek, music volume, Browse, and the tune-in checkbox remain drawer-only. The track list (and the Public tab's broadcast list) was a 160px-fixed scrollable nested inside a second full-height scrollable, showing only a few entries. The outer scrollable is gone and both lists now fill the drawer's remaining height, resizing with the window. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+11
-30
@@ -6737,14 +6737,6 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
};
|
};
|
||||||
let music_panel: Element<'_, AppMessage> = {
|
let music_panel: Element<'_, AppMessage> = {
|
||||||
let music_status = status_snapshot(&state.music_status);
|
let music_status = status_snapshot(&state.music_status);
|
||||||
let music_playing = music_status.playing_id.is_some();
|
|
||||||
let play_label = if music_playing && music_status.paused {
|
|
||||||
"▶"
|
|
||||||
} else if music_playing {
|
|
||||||
"⏸"
|
|
||||||
} else {
|
|
||||||
"▶"
|
|
||||||
};
|
|
||||||
let personal_selected = state.music_tab == MusicTab::Personal;
|
let personal_selected = state.music_tab == MusicTab::Personal;
|
||||||
let public_selected = state.music_tab == MusicTab::Public;
|
let public_selected = state.music_tab == MusicTab::Public;
|
||||||
let tab_row = row![
|
let tab_row = row![
|
||||||
@@ -6863,22 +6855,6 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
.map(format_clip_time)
|
.map(format_clip_time)
|
||||||
.unwrap_or_else(|| "--:--".to_string());
|
.unwrap_or_else(|| "--:--".to_string());
|
||||||
column![
|
column![
|
||||||
row![
|
|
||||||
button(text("|◀").size(13))
|
|
||||||
.on_press(AppMessage::MusicPrev)
|
|
||||||
.style(b_style(color_surface, color_blue, color_text, 6.0))
|
|
||||||
.padding(7),
|
|
||||||
button(text(play_label).size(13))
|
|
||||||
.on_press(AppMessage::MusicPlayPause)
|
|
||||||
.style(b_style(color_blue, color_lavender, color_crust, 6.0))
|
|
||||||
.padding(7),
|
|
||||||
button(text("▶|").size(13))
|
|
||||||
.on_press(AppMessage::MusicNext)
|
|
||||||
.style(b_style(color_surface, color_blue, color_text, 6.0))
|
|
||||||
.padding(7),
|
|
||||||
]
|
|
||||||
.spacing(8)
|
|
||||||
.align_y(iced::alignment::Vertical::Center),
|
|
||||||
slider(
|
slider(
|
||||||
0.0..=1.0,
|
0.0..=1.0,
|
||||||
clip_progress(music_status.position, music_status.total),
|
clip_progress(music_status.position, music_status.total),
|
||||||
@@ -6909,10 +6885,11 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
.text_size(12)
|
.text_size(12)
|
||||||
.on_toggle(AppMessage::MusicToggleBroadcast),
|
.on_toggle(AppMessage::MusicToggleBroadcast),
|
||||||
scrollable(tracks)
|
scrollable(tracks)
|
||||||
.height(iced::Length::Fixed(160.0))
|
.height(iced::Length::Fill)
|
||||||
.width(iced::Length::Fill),
|
.width(iced::Length::Fill),
|
||||||
]
|
]
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
|
.height(iced::Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
MusicTab::Public => {
|
MusicTab::Public => {
|
||||||
@@ -6999,18 +6976,24 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
listen_block,
|
listen_block,
|
||||||
text("Broadcasting now").size(12).color(color_blue),
|
text("Broadcasting now").size(12).color(color_blue),
|
||||||
scrollable(broadcast_rows)
|
scrollable(broadcast_rows)
|
||||||
.height(iced::Length::Fixed(160.0))
|
.height(iced::Length::Fill)
|
||||||
.width(iced::Length::Fill),
|
.width(iced::Length::Fill),
|
||||||
]
|
]
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
|
.height(iced::Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
container(column![tab_row, content,].spacing(10))
|
container(
|
||||||
|
column![tab_row, content,]
|
||||||
|
.spacing(10)
|
||||||
|
.height(iced::Length::Fill),
|
||||||
|
)
|
||||||
.style(c_style(color_mantle, color_surface, 6.0))
|
.style(c_style(color_mantle, color_surface, 6.0))
|
||||||
.padding(10)
|
.padding(10)
|
||||||
.width(iced::Length::Fill)
|
.width(iced::Length::Fill)
|
||||||
|
.height(iced::Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
};
|
};
|
||||||
let music_bar_status = status_snapshot(&state.music_status);
|
let music_bar_status = status_snapshot(&state.music_status);
|
||||||
@@ -7604,9 +7587,7 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
column![
|
column![
|
||||||
text("Playlist").size(18).color(color_blue),
|
text("Playlist").size(18).color(color_blue),
|
||||||
vertical_space(8.0),
|
vertical_space(8.0),
|
||||||
scrollable(music_panel)
|
music_panel,
|
||||||
.width(iced::Length::Fill)
|
|
||||||
.height(iced::Length::Fill),
|
|
||||||
]
|
]
|
||||||
.spacing(0),
|
.spacing(0),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user