Add a first cut of context menus, opened from the "more" (ellipsis) button on Discover album cards and on album track rows. - ContextMenu / ContextMenuItem primitives (PopupWindow-hosted panel) - AlbumCard: the overlay action buttons are now interactive (they gate their pointer handling so non-hovered cards still open on click); the more button opens a menu — Open album, Play, Add to queue, Add to favorites - TrackRow: a hover-revealed more button opens a menu — Play, Add to queue, Add to favorites; AlbumTrackItem and TrackData carry the track id - Menu actions bubble up as a single media-action(kind, id, action) callback through the shell; main.rs logs it for now — playback and favorites wiring lands with the playback session - user and list-plus icons cc
83 lines
2.4 KiB
Plaintext
83 lines
2.4 KiB
Plaintext
// QBZ Slint MVP — UI entry point.
|
|
//
|
|
// Stays thin: imports the feature screens and exports the single
|
|
// top-level window. No raw visual constants or domain logic here
|
|
// (MVP ADR, sections 13 and 21).
|
|
|
|
import { Theme } from "foundation/semantic-colors.slint";
|
|
import { SplashScreen } from "splash/SplashScreen.slint";
|
|
import { LoginScreen } from "login/LoginScreen.slint";
|
|
import { AppShell } from "shell/AppShell.slint";
|
|
|
|
// Re-export the state globals so the Rust layer can populate them.
|
|
export { HomeState, AlbumState, ArtistState, NavState, SessionState, SettingsState } 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`.
|
|
export enum AppScreen { splash, login, shell }
|
|
|
|
export component AppWindow inherits Window {
|
|
title: "QBZ";
|
|
preferred-width: 1180px;
|
|
preferred-height: 760px;
|
|
min-width: 940px;
|
|
min-height: 600px;
|
|
background: Theme.surface-main;
|
|
|
|
in-out property <AppScreen> screen: AppScreen.splash;
|
|
|
|
// Forwarded to the Rust layer.
|
|
callback sign-in-via-browser();
|
|
callback use-system-browser();
|
|
callback start-offline();
|
|
callback open-tos();
|
|
callback open-album(string);
|
|
callback open-artist(string);
|
|
callback media-action(string, string, string);
|
|
callback settings-bool(string, bool);
|
|
callback settings-select(string, int);
|
|
callback logout();
|
|
callback close-app();
|
|
|
|
if root.screen == AppScreen.splash: SplashScreen { }
|
|
|
|
if root.screen == AppScreen.login: LoginScreen {
|
|
sign-in-via-browser => {
|
|
root.sign-in-via-browser();
|
|
}
|
|
use-system-browser => {
|
|
root.use-system-browser();
|
|
}
|
|
start-offline => {
|
|
root.start-offline();
|
|
}
|
|
open-tos => {
|
|
root.open-tos();
|
|
}
|
|
}
|
|
|
|
if root.screen == AppScreen.shell: AppShell {
|
|
open-album(id) => {
|
|
root.open-album(id);
|
|
}
|
|
open-artist(id) => {
|
|
root.open-artist(id);
|
|
}
|
|
media-action(kind, id, action) => {
|
|
root.media-action(kind, id, action);
|
|
}
|
|
settings-bool(k, v) => {
|
|
root.settings-bool(k, v);
|
|
}
|
|
settings-select(k, i) => {
|
|
root.settings-select(k, i);
|
|
}
|
|
logout => {
|
|
root.logout();
|
|
}
|
|
close-app => {
|
|
root.close-app();
|
|
}
|
|
}
|
|
}
|