Files
qbz/crates/qbz-slint/ui/shell/AppShell.slint
T
vicrodh bb6fd1e0f3 feat(slint): minimal search results view, functional end to end
SearchResultsView renders the four SearchState categories; mounted in
AppShell on ContentView.search. Phase 1 is now functional end to end:
header input -> debounced search -> QbzCore::search_all -> results.
Phase 2 builds this into the tabbed dashboard.

cc
2026-05-19 11:46:16 -06:00

147 lines
5.2 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, ShellState } from "../state.slint";
import { Sidebar } from "Sidebar.slint";
import { HeaderBar } from "HeaderBar.slint";
import { HeaderMenuOverlay } from "HeaderMenuOverlay.slint";
import { PlayerBar } from "PlayerBar.slint";
import { QueueSidebar } from "QueueSidebar.slint";
import { LyricsSidebar } from "LyricsSidebar.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";
import { SearchResultsView } from "../search/SearchResultsView.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 settings-slider(string, int);
callback settings-reset();
callback logout();
callback close-app();
background: Theme.surface-main;
// Bottom layer: catches the mouse back / forward buttons for history
// navigation. Declared first so the real UI sits on top of it.
TouchArea {
pointer-event(e) => {
if (e.kind == PointerEventKind.down) {
if (e.button == PointerEventButton.back) {
NavState.request-back();
}
if (e.button == PointerEventButton.forward) {
NavState.request-forward();
}
}
}
}
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);
}
settings-slider(k, v) => {
root.settings-slider(k, v);
}
settings-reset => {
root.settings-reset();
}
}
if NavState.view == ContentView.search: SearchResultsView {
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);
}
}
}
// Right-side panels — layout siblings of the content area, so
// they shrink the content rather than overlaying it. Always
// present; each animates its own width open/closed.
QueueSidebar { }
LyricsSidebar { }
}
PlayerBar {
open-album(id) => {
root.open-album(id);
}
open-artist(id) => {
root.open-artist(id);
}
}
}
// Header nav-tab dropdown menus. Declared LAST so it draws on top of
// the header and the content region. A plain in-window overlay (not
// a PopupWindow) — it does not grab the pointer, so the header tabs
// stay hoverable and menus can be hover-switched instantly.
HeaderMenuOverlay { }
}