feat(slint): immersive views polish — 50/50 split, no glass, sharp art, default-view

Split layout is a true 50/50 (explicit half-widths; the horizontal-stretch weights skewed it because the left's intrinsic content out-measured the right). Removed the glass backing plates from the split panel and the song-data metadata block — both sit directly on the atmosphere now.

Cover art no longer upscales blurry on large windows: the now-playing large cover decodes at 1000px (was 300, the hover-preview size) so the full Qobuz source resolution comes through, and the split / Static / Album-Reactive panels cap the art at its native size so it grows sharply instead of stretching.

New Settings > Appearance 'Immersive default view': 'Remember last' restores the last view, or pin Album Reactive / Static / Coverflow / Spectrum / Lyrics / Queue. Persisted via ui_prefs + ImmersiveActions opened/view-changed hooks.

cc
This commit is contained in:
vicrodh committed 2026-06-20 19:45:16 -06:00
1 parent d0deeb7044
commit 85b02417be
9 files changed
+244 -25

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ export { Theme, ThemeColors } from "foundation/semantic-colors.slint";
export { ThemeState } from "foundation/theme-state.slint";
// Re-export the state globals so the Rust layer can populate them.
export { HomeState, HomeActions, DiscoverState, DiscoverActions, SectionDescriptor, ConfigRow, DiscoverBrowseState, DiscoverBrowseActions, ForYouState, MixState, GenreFilterState, GenreFilterActions, AlbumState, ArtistState, NavState, ShellState, SessionState, SettingsState, AlbumActions, ArtistActions, ArtworkActions, NowPlayingState, QueueState, LyricsState, LyricsLineItem, SearchState, SearchActions, NetworkSidebarState, NetworkSidebarActions, MusicianState, MusicianActions, LabelState, LabelActions, AwardState, AwardActions, AwardEntry, LocationViewState, LocationViewActions, FavoritesState, FavoritesActions, PlaylistPickerState, PlaylistPickerActions, DuplicateConfirmState, DuplicateConfirmActions, PlaylistState, PlaylistActions, SidebarState, SidebarActions, SidebarFolderPopupState, CreatePlaylistState, CreatePlaylistActions, EditPlaylistState, EditPlaylistActions, CreateFolderState, CreateFolderActions, MyQbzCreateState, MyQbzCreateActions, DragState, DragActions, PlaylistManagerState, PlaylistManagerActions, OfflineManagerState, OfflineManagerActions, BlacklistState, BlacklistActions, BlacklistedArtistItem, MyQbzState, MyQbzActions, MixtapeCardItem, MyQbzAddState, MyQbzAddActions, MyQbzAddRow, MyQbzDetailState, MyQbzDetailActions, MixtapeDetailItem, MyQbzEditState, MyQbzEditActions, MyQbzMixState, MyQbzMixActions, DiscoBuilderState, DiscoBuilderActions, DiscoGroup, DiscoCandidate, LocalLibraryState, LocalLibraryActions, LibraryFoldersState, LibFolderEditState, LibraryManageActions, LibraryScanState, LibAlbumFilterState, LocalAlbumState, LocalAlbumActions, TagEditorState, TagEditorActions, FolderEditState, FolderEditActions, ToastState, TextUtil, QconnectDevState, QconnectDevice, CastState, CastDevice, CastActions, AppearanceState, MyQbzBrandingState, EphemeralPlayChoiceState, EphemeralPlayChoiceActions, PlexSettingsState, PlexAuthActions, PlexSectionItem, ScrobbleState, ScrobbleActions, OfflineState, OfflineModeActions, OfflineFavoritesState, OfflineFavoritesActions, ImportLogEntry, PlaylistImportState, PlaylistImportActions, DacWizardState, DacWizardActions, DacCandidateRow, RemediationRow, DacConfigRow, InfoCreditRow, InfoCreditPair, AlbumCreditPerformer, AlbumCreditTrack, TrackInfoState, TrackInfoActions, AlbumInfoState, AlbumInfoActions, SuggestionsState, SuggestionsActions, SuggestionCard, VisualizerState, ImmersiveState, ImmersiveSearchActions, MiniPlayerState, WindowControlActions } from "state.slint";
export { HomeState, HomeActions, DiscoverState, DiscoverActions, SectionDescriptor, ConfigRow, DiscoverBrowseState, DiscoverBrowseActions, ForYouState, MixState, GenreFilterState, GenreFilterActions, AlbumState, ArtistState, NavState, ShellState, SessionState, SettingsState, AlbumActions, ArtistActions, ArtworkActions, NowPlayingState, QueueState, LyricsState, LyricsLineItem, SearchState, SearchActions, NetworkSidebarState, NetworkSidebarActions, MusicianState, MusicianActions, LabelState, LabelActions, AwardState, AwardActions, AwardEntry, LocationViewState, LocationViewActions, FavoritesState, FavoritesActions, PlaylistPickerState, PlaylistPickerActions, DuplicateConfirmState, DuplicateConfirmActions, PlaylistState, PlaylistActions, SidebarState, SidebarActions, SidebarFolderPopupState, CreatePlaylistState, CreatePlaylistActions, EditPlaylistState, EditPlaylistActions, CreateFolderState, CreateFolderActions, MyQbzCreateState, MyQbzCreateActions, DragState, DragActions, PlaylistManagerState, PlaylistManagerActions, OfflineManagerState, OfflineManagerActions, BlacklistState, BlacklistActions, BlacklistedArtistItem, MyQbzState, MyQbzActions, MixtapeCardItem, MyQbzAddState, MyQbzAddActions, MyQbzAddRow, MyQbzDetailState, MyQbzDetailActions, MixtapeDetailItem, MyQbzEditState, MyQbzEditActions, MyQbzMixState, MyQbzMixActions, DiscoBuilderState, DiscoBuilderActions, DiscoGroup, DiscoCandidate, LocalLibraryState, LocalLibraryActions, LibraryFoldersState, LibFolderEditState, LibraryManageActions, LibraryScanState, LibAlbumFilterState, LocalAlbumState, LocalAlbumActions, TagEditorState, TagEditorActions, FolderEditState, FolderEditActions, ToastState, TextUtil, QconnectDevState, QconnectDevice, CastState, CastDevice, CastActions, AppearanceState, MyQbzBrandingState, EphemeralPlayChoiceState, EphemeralPlayChoiceActions, PlexSettingsState, PlexAuthActions, PlexSectionItem, ScrobbleState, ScrobbleActions, OfflineState, OfflineModeActions, OfflineFavoritesState, OfflineFavoritesActions, ImportLogEntry, PlaylistImportState, PlaylistImportActions, DacWizardState, DacWizardActions, DacCandidateRow, RemediationRow, DacConfigRow, InfoCreditRow, InfoCreditPair, AlbumCreditPerformer, AlbumCreditTrack, TrackInfoState, TrackInfoActions, AlbumInfoState, AlbumInfoActions, SuggestionsState, SuggestionsActions, SuggestionCard, VisualizerState, ImmersiveState, ImmersiveSearchActions, ImmersiveActions, MiniPlayerState, WindowControlActions } from "state.slint";
// Which top-level screen is shown. The app starts on `splash` while it
// restores a saved session, then resolves to `shell` or `login`.
@@ -77,8 +77,16 @@ export component AlbumReactivePanel inherits Rectangle {
// window; we raise the hard cap from 460 -> 660px and the width fraction
// 0.55 -> 0.62 so the art keeps growing on a big screen instead of stalling.
// The 180px floor keeps small windows safe (small was confirmed good).
// Native source resolution — cap the RESTING art so it is never upscaled
// beyond its own size on a large window (owner: oversized blurry art looked
// nefasto). The audio breathing (art-scale) still grows it momentarily — that
// is the intended reactive effect, not the static oversizing being fixed.
property <length> src-native:
(NowPlayingState.artwork-large.width > 0
? NowPlayingState.artwork-large.width
: NowPlayingState.artwork.width) * 1px;
property <length> base-art: Math.max(180px,
Math.min(Math.min((root.viewport-height - 384px) / 1.25, root.viewport-width * 0.62), 660px));
Math.min(Math.min(Math.min((root.viewport-height - 384px) / 1.25, root.viewport-width * 0.62), 660px), root.src-native));
// Reactive size = base * artScale. The glow layer and the art share this
// exact size/position so the halo stays glued to the art edge (per risk).
property <length> art-size: root.base-art * root.art-scale;
@@ -5,7 +5,7 @@
import { Radius } from "../foundation/radius.slint";
import { Typography } from "../foundation/typography.slint";
import { QbzIcon } from "../primitives/QbzIcon.slint";
import { NowPlayingState, VisualizerState, ImmersiveState, ImmersiveSearchActions, SettingsState, LyricsState, QueueState, TrackInfoActions, SuggestionsActions, WindowControlActions, ShellState } from "../state.slint";
import { NowPlayingState, VisualizerState, ImmersiveState, ImmersiveSearchActions, ImmersiveActions, SettingsState, LyricsState, QueueState, TrackInfoActions, SuggestionsActions, WindowControlActions, ShellState } from "../state.slint";
import { ImmersiveSearchCortinilla } from "ImmersiveSearchCortinilla.slint";
import { ImmersiveAtmosphere } from "ImmersiveAtmosphere.slint";
import { AlbumReactivePanel } from "AlbumReactivePanel.slint";
@@ -1089,6 +1089,18 @@ export component ImmersiveView inherits Rectangle {
background: #0a0a0b;
clip: true;
// The component is conditionally mounted (it exists only while the overlay is
// OPEN), so init == the overlay opening. Rust applies the configured default
// view here (pinned view, or restore-last). Per the precedent this is the
// only `init` on the root.
init => { ImmersiveActions.opened(); }
// Fingerprint of the active view (view-mode * 100 + mode * 10 + split-panel).
// Any change while the overlay is open fires `view-changed()` so Rust can
// persist the current view for the "Remember last" default.
property <int> view-sig: ImmersiveState.view-mode * 100 + ImmersiveState.mode * 10 + ImmersiveState.split-panel;
changed view-sig => { ImmersiveActions.view-changed(); }
function wake() {
root.chrome-visible = true;
hide-timer.running = false;
@@ -1271,11 +1283,13 @@ export component ImmersiveView inherits Rectangle {
padding-right: 56px;
spacing: 48px;
// LEFT (~55%): artwork + shared metadata block, centered in its half.
// horizontal-stretch 11 (vs the right's 9) yields the 55/45 ratio.
// LEFT (50%): artwork + shared metadata block, centered in its half.
// EXPLICIT half-width (root.width minus the 56+56 padding and 48 spacing,
// halved) gives a true 50/50 — horizontal-stretch weights did not, because
// the left's intrinsic content out-measured the right and skewed the split.
left-col := VerticalLayout {
property <length> col-h: parent.col-h;
horizontal-stretch: 11;
width: (root.width - 160px) / 2;
alignment: center;
spacing: 28px;
@@ -1285,9 +1299,17 @@ export component ImmersiveView inherits Rectangle {
// `self.width` is the layout-resolved column width; it only drives
// `height`, never the column's own width, so there's no loop.
left-art := Rectangle {
// Native source resolution (physical px) of the active cover, so
// the art is never UPSCALED beyond its own size on a large window
// (the cause of the blurry oversized cover when the window leaves
// the responsive/constrained range).
property <length> src-native:
(NowPlayingState.artwork-large.width > 0
? NowPlayingState.artwork-large.width
: NowPlayingState.artwork.width) * 1px;
property <length> art-size:
Math.max(240px,
Math.min(self.width, left-col.col-h - 200px));
Math.min(self.width, left-col.col-h - 200px, self.src-native));
height: self.art-size;
horizontal-stretch: 1;
art-inner := Rectangle {
@@ -1317,10 +1339,9 @@ export component ImmersiveView inherits Rectangle {
// plate is full column width with 22px side gutters so the elided
// Text rows have a real width to truncate against.
meta-plate := Rectangle {
background: #00000059;
border-radius: 14px;
border-width: 1px;
border-color: #ffffff14;
// Glass plate removed (owner: looked bad) — the metadata sits
// directly on the atmosphere; ImmersiveTrackInfo carries its own
// text shadows for legibility.
horizontal-stretch: 1;
height: meta-block.preferred-height + 28px;
meta-block := VerticalLayout {
@@ -1345,19 +1366,13 @@ export component ImmersiveView inherits Rectangle {
// via viewport-width/viewport-height so it never overflows the corners.
// horizontal-stretch 9 (vs the left's 11) yields the 45% share.
right-plate := Rectangle {
// The backing's inner padding. The mounted panel's content box
// The panel's inner padding. The mounted panel's content box
// (`right-inner`) subtracts this on both axes so nothing tucks under
// the rounded corners.
// the edges.
property <length> pad: 20px;
horizontal-stretch: 9;
// The dark legibility plate.
background: #00000094;
border-radius: 16px;
border-width: 1px;
border-color: #ffffff1a;
drop-shadow-blur: 36px;
drop-shadow-color: #00000080;
drop-shadow-offset-y: 10px;
width: (root.width - 160px) / 2;
// Glass legibility backing removed (owner: looked bad) — the split
// panel sits directly on the atmosphere.
clip: true;
// Inner content box, inset by the backing padding on all sides.
@@ -41,8 +41,14 @@ export component StaticPanel inherits Rectangle {
// scales, and we raise the hard cap 460 -> 640px and the width fraction
// 0.55 -> 0.62 so a big window is filled. The 180px floor keeps small windows
// safe (small was confirmed good).
// Native source resolution — cap so the cover is never UPSCALED beyond its
// own size on a large window (owner: oversized blurry art looked nefasto).
property <length> src-native:
(NowPlayingState.artwork-large.width > 0
? NowPlayingState.artwork-large.width
: NowPlayingState.artwork.width) * 1px;
property <length> base-art: Math.max(180px,
Math.min(Math.min(root.viewport-height - 364px, root.viewport-width * 0.62), 640px));
Math.min(Math.min(Math.min(root.viewport-height - 364px, root.viewport-width * 0.62), 640px), root.src-native));
// Fixed size — no art-scale.
property <length> art-size: root.base-art;
@@ -305,6 +305,20 @@ export component AppearanceSettings inherits VerticalLayout {
}
}
SettingRow {
label: @tr("Immersive default view");
description: @tr("Which immersive view opens by default. 'Remember last' restores your last view.");
QbzSelect {
menu-width: 200px;
options: AppearanceState.immersive-default-views;
current-index: AppearanceState.immersive-default-view-index;
selected(i) => {
AppearanceState.immersive-default-view-index = i;
AppearanceState.appearance-select("immersive-default-view", i);
}
}
}
Rectangle { height: 12px; }
Divider { }
Rectangle { height: 12px; }
+18
View File
@@ -2606,6 +2606,14 @@ export global AppearanceState {
in-out property <[string]> immersive-search-actions: ["Disabled", "Replace current queue", "Play next", "Add to queue"];
in-out property <int> immersive-search-action-index: 1;
// Immersive default view — which immersive view opens by default.
// 0 = Remember last (restore the last view that was open),
// 1 = Album Reactive, 2 = Static, 3 = Coverflow, 4 = Spectrum,
// 5 = Lyrics, 6 = Queue (all 1-6 pin a FOCUS view-mode foreground).
// Persisted via appearance-select("immersive-default-view").
in-out property <[string]> immersive-default-views: ["Remember last", "Album Reactive", "Static", "Coverflow", "Spectrum", "Lyrics", "Queue"];
in-out property <int> immersive-default-view-index: 0;
// --- VISUAL EXTRAS -----------------------------------------------------
// sidebar-playlist-collage is wired to SidebarState.playlist-collage in
// the panel (the only already-functional flag here).
@@ -3389,6 +3397,16 @@ export global ImmersiveSearchActions {
callback dismiss();
}
// Lifecycle hooks for the immersive overlay, wired in main.rs. The ImmersiveView
// component is conditionally mounted (it exists only while the overlay is OPEN),
// so its `init` == the overlay opening. `opened()` lets Rust apply the configured
// default view (pinned, or restore-last); `view-changed()` lets Rust persist the
// current view when the configured default is "remember last".
export global ImmersiveActions {
callback opened();
callback view-changed();
}
// Native window-control actions for the MAIN AppWindow, exposed to the
// immersive overlay header cluster. The AppWindow uses native OS decorations,
// so the only seam to manipulate it is the winit backend (see