Files
qbz/crates/qbz-slint/ui/shell/AppShell.slint
T
vicrodh 7eb9627eab feat(slint): context menus for album cards and track rows
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
2026-05-18 17:32:56 -06:00

90 lines
3.0 KiB
Plaintext

// App shell — the post-login frame: header bar, sidebar, content
// region, and player bar. The content region shows the Discover Home,
// Album detail, or Artist detail view, driven by NavState.
//
// Regions are delineated by their surface colors (chrome over the darker
// content well); no hairline borders.
import { Theme } from "../foundation/semantic-colors.slint";
import { NavState, ContentView } from "../state.slint";
import { Sidebar } from "Sidebar.slint";
import { HeaderBar } from "HeaderBar.slint";
import { PlayerBar } from "PlayerBar.slint";
import { HomeView } from "../discover/HomeView.slint";
import { AlbumPageView } from "../album/AlbumPageView.slint";
import { ArtistPageView } from "../artist/ArtistPageView.slint";
import { SettingsView } from "../settings/SettingsView.slint";
export component AppShell inherits Rectangle {
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();
background: Theme.surface-main;
VerticalLayout {
spacing: 0px;
HeaderBar {
logout => {
root.logout();
}
close-app => {
root.close-app();
}
}
HorizontalLayout {
vertical-stretch: 1;
spacing: 0px;
Sidebar { }
// Content region — Home, Album, or Artist.
Rectangle {
horizontal-stretch: 1;
background: Theme.surface-main;
if NavState.view == ContentView.home: HomeView {
album-clicked(id) => {
root.open-album(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
if NavState.view == ContentView.album: AlbumPageView {
open-artist(id) => {
root.open-artist(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
if NavState.view == ContentView.artist: ArtistPageView {
open-album(id) => {
root.open-album(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
if NavState.view == ContentView.settings: SettingsView {
settings-bool(k, v) => {
root.settings-bool(k, v);
}
settings-select(k, i) => {
root.settings-select(k, i);
}
}
}
}
PlayerBar { }
}
}