diff --git a/Cargo.lock b/Cargo.lock
index ae04978..740c645 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2998,6 +2998,7 @@ dependencies = [
"directories",
"iced",
"iced_test",
+ "image",
"keyring",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
diff --git a/DESIGN.md b/DESIGN.md
index 91d2157..dd8b574 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -198,7 +198,8 @@ A near-monochrome violet-grey palette with a single warm amber and two quiet sta
### Primary
- **Indicator Amber** (`accent`): the playing track's title, the progress fill, primary buttons,
selected chips, the active nav icon, the active tab underline, the focused search border, the
- wordmark dot and the My Wave hero lines. The Lossless quality badge also turns amber when Yandex
+ wordmark dot, the My Wave hero lines, and on Now Playing the play disc and the line being sung.
+ The Lossless quality badge also turns amber when Yandex
serves FLAC.
- **Amber Ink** (`accent-ink`): text and icons placed on amber.
@@ -281,10 +282,12 @@ that float above the content.
- **Menu float** (0 10px 28px, black 30%): the context menu and its submenu.
- **Toast float** (0 6px 18px, black 30%): the status pill above the player bar.
- **Dialog float** (0 18px 50px, black 35%), over a 45% black backdrop: dialogs only.
+- **Stage float** (0 18px 50px, black 35%), no backdrop: the large cover on Now Playing, which
+ floats over its own blurred copy.
### Named Rules
-**The Float-Only Shadow Rule.** If it isn't floating above the content (menu, toast, dialog) and
-it isn't the primary button, it has no shadow.
+**The Float-Only Shadow Rule.** If it isn't floating above the content (menu, toast, dialog, the
+Now Playing cover) and it isn't a primary button, it has no shadow.
**The No-Dim Rule.** Only dialogs dim the window. Menus, the drawer and toasts never do.
@@ -347,11 +350,12 @@ rounded corners.
### Player bar
- `panel` fill, 80pt tall, in three zones.
-- **Left:** a 52pt cover with the title and artist, then like and dislike buttons. Right-clicking
- the cover or title opens the track's menu.
+- **Left:** a 52pt cover with the title and artist, then like and dislike buttons. Clicking the
+ cover or title opens Now Playing; right-clicking it opens the track's menu.
- **Centre:** shuffle, previous, the play disc, next and repeat, above a 4pt seek rail with an
amber fill. The rail's handle appears only on hover or drag. Times sit on either side.
-- **Right:** the quality badge, lyrics, queue, and a volume rail with an `fg` fill.
+- **Right:** the quality badge, Now Playing (expand), lyrics, queue, and a volume rail with an
+ `fg` fill.
### Track row
- 52pt tall, built as a button. Columns in order:
@@ -400,6 +404,23 @@ rounded corners.
"and N more". Clicking a row jumps to it. Right-click opens the queue version of the track menu.
- **Lyrics:** synced lyrics follow playback.
+### Now Playing
+- Follows the Apple TV app's Now Playing. It covers the whole window, player bar included, until
+ closed with the chevron at its top left, Esc, ⌘P or Back. Going to an album or artist from its
+ menu closes it too.
+- **Backdrop:** the cover shrunk to 32px, blurred and stretched over the window, washed with
+ `bg` from 55% at the top to 92% at the bottom. Until the cover loads, its placeholder gradient
+ stands in.
+- **Stage:** the cover at hero radius with the stage float, as large as the window allows between
+ 160 and 520pt, and beside it the quality badge, the title in display-m (wrapping), the artists in
+ section `fg`, and the album in `muted`. A playback notice shows in `like`. With synced lyrics, the
+ line being sung shows under them in section amber.
+- **Seek:** a 6pt rail with an amber fill across the stage, the times under its ends.
+- **Controls:** shuffle, previous, a 56pt amber play disc (the primary style), next and repeat at
+ 20pt; then the heart, "…", Queue and Lyrics pills (chip style, filled while their panel is open)
+ and the volume. Below 820pt of stage width the pills lose their labels.
+- **Drawer:** opens at the right edge as in the main window, and Esc closes it before Now Playing.
+
### Dialogs
- 380pt `panel` card with card radius and the dialog float over a dimmed window.
- Used only when you type or confirm: New playlist, Rename playlist, and Delete playlist.
@@ -427,7 +448,8 @@ rounded corners.
- ⌘L: like
- ⌘F or `/`: search
- ⌘[ or ⌥←: back
- - Esc: closes a drag, menu, dialog, suggestions or the drawer, in that order
+ - ⌘P: Now Playing
+ - Esc: closes a drag, menu, dialog, suggestions, the drawer or Now Playing, in that order
- ⌘1–5: nav sections
- ⌘,: Settings
- ⌘ is Ctrl on Windows and Linux.
diff --git a/crates/musyx/Cargo.toml b/crates/musyx/Cargo.toml
index b21ec3c..3e0da5e 100644
--- a/crates/musyx/Cargo.toml
+++ b/crates/musyx/Cargo.toml
@@ -20,6 +20,8 @@ tokio = { version = "1", features = ["time", "rt", "fs", "sync"] }
directories = "6.0.0"
sys-locale = "0.3.2"
png = { version = "0.18.1", optional = true }
+# Already built for iced's image widget; used directly to blur the Now Playing backdrop.
+image = { version = "0.25", default-features = false }
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.3"
diff --git a/crates/musyx/assets/icons/chevron-down.svg b/crates/musyx/assets/icons/chevron-down.svg
new file mode 100644
index 0000000..84e1f26
--- /dev/null
+++ b/crates/musyx/assets/icons/chevron-down.svg
@@ -0,0 +1,15 @@
+
+
diff --git a/crates/musyx/assets/icons/maximize-2.svg b/crates/musyx/assets/icons/maximize-2.svg
new file mode 100644
index 0000000..fcc5bab
--- /dev/null
+++ b/crates/musyx/assets/icons/maximize-2.svg
@@ -0,0 +1,18 @@
+
+
diff --git a/crates/musyx/src/app.rs b/crates/musyx/src/app.rs
index cdcb462..679e068 100644
--- a/crates/musyx/src/app.rs
+++ b/crates/musyx/src/app.rs
@@ -30,7 +30,7 @@ use crate::store::{self, Appearance, Locale, Quality, Settings};
use crate::ui::theme::{self, shell};
use crate::widgets::drawer::{self, Panel};
use crate::widgets::menu::{self, Menu};
-use crate::widgets::player_bar;
+use crate::widgets::{now_playing, player_bar};
use crate::widgets::sheet::{self, Sheet};
use crate::widgets::track_list::{Drag, Env};
use crate::widgets::{sidebar, topbar};
@@ -54,6 +54,8 @@ pub struct App {
nav: Navigator,
search: Search,
drawer: Option,
+ /// Now Playing covers the window, player bar included.
+ now_playing: bool,
player: Player,
library: Library,
/// Album, artist and playlist pages visited this session.
@@ -106,6 +108,7 @@ pub enum Message {
Search(search::Msg),
ToggleDrawer(Panel),
CloseDrawer,
+ ShowNowPlaying(bool),
Player(player::Msg),
PlayTracks { tracks: Arc<[Track]>, start: usize, shuffle: bool },
LoadLiked,
@@ -207,6 +210,7 @@ impl App {
nav: Navigator::new(Route::Home),
search: Search::default(),
drawer: None,
+ now_playing: false,
player: Player::default(),
library: Library::default(),
pages: HashMap::new(),
@@ -260,6 +264,11 @@ impl App {
app.pages.insert(Route::Playlist(crate::snapshot::OWN_PLAYLIST), Loadable::Loaded(config.sample_playlist()));
app.menu = config.menu();
app.drag = config.drag();
+ if config.now_playing {
+ app.now_playing = true;
+ let tracks = config.sample_liked().into();
+ let _ = app.player.update(player::Msg::Play { tracks, start: 0, shuffle: None });
+ }
if let Some(route) = config.route {
app.nav = Navigator::new(route);
}
@@ -368,6 +377,11 @@ impl App {
pub fn update(&mut self, message: Message) -> Task {
let traced = trace(&message);
let task = self.update_inner(message);
+ if self.now_playing
+ && let Some(url) = self.player.track().and_then(|t| t.cover_url(crate::covers::LARGE))
+ {
+ self.covers.make_backdrop(&url);
+ }
if traced {
let now = self.player.track().map_or("-".to_owned(), |t| t.full_title());
let next: Vec = self
@@ -494,6 +508,7 @@ impl App {
self.session = Session::SignedOut(Box::default());
self.nav = Navigator::new(Route::Home);
self.drawer = None;
+ self.now_playing = false;
self.player.reset();
self.mini_player.update(None, self.player.status());
self.library = Library::default();
@@ -509,6 +524,7 @@ impl App {
Message::Navigate(route) => {
self.sheet = None;
self.menu = None;
+ self.now_playing = false;
self.nav.go(route);
let (close, _) = self.search.update(search::Msg::CloseSuggestions, None);
// Opening Search is a request to type.
@@ -525,6 +541,8 @@ impl App {
return task;
}
}
+ // Back from Now Playing returns to the page under it.
+ Message::Back if self.now_playing => self.now_playing = false,
Message::Back => {
self.nav.back();
return self.on_enter(self.nav.current());
@@ -544,6 +562,10 @@ impl App {
return self.want_lyrics();
}
Message::CloseDrawer => self.drawer = None,
+ Message::ShowNowPlaying(show) => {
+ self.now_playing = show;
+ return self.want_lyrics();
+ }
Message::Player(msg) => {
let before = self.player.track().map(|t| t.id.clone());
let seeked = matches!(msg, player::Msg::Seek(_) | player::Msg::SeekCommit);
@@ -1005,7 +1027,7 @@ impl App {
Message::LikeTrack(track, !liked)
}
Shortcut::FocusSearch => return focus_search(),
- Shortcut::Back if self.nav.can_go_back() => Message::Back,
+ Shortcut::Back if self.now_playing || self.nav.can_go_back() => Message::Back,
Shortcut::Back => return Task::none(),
Shortcut::Dismiss => {
if self.drag.is_some() {
@@ -1016,12 +1038,17 @@ impl App {
self.sheet = None;
} else if self.search.suggestions().is_some() {
return self.update(Message::Search(search::Msg::CloseSuggestions));
- } else {
+ } else if self.drawer.is_some() {
self.drawer = None;
+ } else {
+ self.now_playing = false;
}
return Task::none();
}
Shortcut::Go(route) => Message::Navigate(route),
+ Shortcut::NowPlaying if self.now_playing => Message::ShowNowPlaying(false),
+ Shortcut::NowPlaying if self.player.track().is_some() => Message::ShowNowPlaying(true),
+ Shortcut::NowPlaying => return Task::none(),
Shortcut::MenuUp | Shortcut::MenuDown | Shortcut::MenuIn | Shortcut::MenuOut | Shortcut::MenuEnter => {
return self.menu_key(shortcut);
}
@@ -1227,6 +1254,42 @@ impl App {
}
fn shell<'a>(&'a self, t: &'static theme::Tokens, account: &'a Account) -> Element<'a, Message> {
+ let liked = self.player.track().is_some_and(|tr| self.library.liked.contains(&tr.id));
+ let lyrics = self.player.track().and_then(|tr| self.lyrics.get(&tr.id));
+ let window = if self.now_playing {
+ now_playing::view(now_playing::Ctx {
+ t,
+ player: &self.player,
+ liked,
+ drawer: self.drawer,
+ covers: &self.covers,
+ lyrics,
+ })
+ } else {
+ self.browsing(t, account, liked, lyrics)
+ };
+
+ let mut layers = stack![container(window).width(Fill).height(Fill).style(theme::app)];
+ if let Some((text, _)) = &self.toast {
+ layers = layers.push(sheet::toast(t, text));
+ }
+ if let Some(open) = &self.sheet {
+ layers = layers.push(sheet::overlay(t, open));
+ }
+ if let Some(open) = &self.menu {
+ layers = layers.push(menu::layer(t, open, self.menu_ctx(&open.target)));
+ }
+ layers.into()
+ }
+
+ /// Sidebar, page and drawer over the player bar.
+ fn browsing<'a>(
+ &'a self,
+ t: &'static theme::Tokens,
+ account: &'a Account,
+ liked: bool,
+ lyrics: Option<&'a Loadable