// Global floating album-art preview — a 220x220 high-res cover that floats // ABOVE the now-playing bar's small cover while the pointer hovers it (1:1 with // Tauri). Mounted LAST in AppShell (on top of everything), fills the window and // is NON-INTERACTIVE (no TouchArea → clicks pass through and, crucially, it // never steals hover from the trigger — a PopupWindow did, causing flicker). // Driven by ArtPreviewState (anchor + visibility); reads the cover straight // from NowPlayingState. import { Theme } from "../foundation/semantic-colors.slint"; import { ArtPreviewState, NowPlayingState } from "../state.slint"; export component ArtPreviewOverlay inherits Rectangle { // root fills the window; transparent + non-interactive. visible: ArtPreviewState.show && NowPlayingState.has-track; property card: 232px; Rectangle { width: root.card; height: root.card; // Centred on the art (clamped 8px inside the window), floating just // above it (bottom ~8px above the art's top edge). x: Math.clamp(ArtPreviewState.anchor-x - self.width / 2, 8px, Math.max(8px, root.width - self.width - 8px)); y: ArtPreviewState.anchor-y - self.height - 8px; border-radius: 8px; background: Theme.surface-card; border-width: 1px; border-color: Theme.border-subtle; drop-shadow-blur: 16px; drop-shadow-color: #00000088; clip: true; Image { width: 220px; height: 220px; x: 6px; y: 6px; image-fit: contain; source: NowPlayingState.artwork-large.width > 0 ? NowPlayingState.artwork-large : NowPlayingState.artwork; } } }