M1 progress. Adds the foundation token layer (palette, semantic colors, spacing, radius, typography) bound to the QBZ dark theme, three primitives (QbzCheckbox, QbzPrimaryButton, QbzTextLink), and the LoginScreen feature component. The login screen mirrors the Svelte LoginView: centered card, logo, QBZ wordmark, Qobuz ToS checkbox, "Sign in via Browser" button, system-browser and offline links, and the legal disclaimer. Colors are lifted verbatim from src/app.css; strings use @tr() markers. Rust side: typed AppCommand enum; UI callbacks dispatch through it. M2 wires the command handler to AppRuntime. cc
39 lines
1.4 KiB
Rust
39 lines
1.4 KiB
Rust
//! QBZ Slint POC binary.
|
|
//!
|
|
//! Validates whether Slint can become QBZ's future UI foundation on top of
|
|
//! the framework-agnostic `qbz-app` / `qbz-core` stack. See the POC ADR
|
|
//! (`qbz-nix-docs/qbz-adr/qbz_slint_functional_poc_adr.md`).
|
|
//!
|
|
//! Lives only on the private `slint-poc` branch (ADR-007). The Slint UI tree
|
|
//! is compiled from `ui/app.slint` by `build.rs`; `include_modules!` pulls in
|
|
//! the generated Rust bindings.
|
|
//!
|
|
//! M1 status: foundation tokens + login screen. UI callbacks reach the
|
|
//! typed-command layer; M2 wires that layer to `AppRuntime`.
|
|
|
|
slint::include_modules!();
|
|
|
|
mod commands;
|
|
|
|
use commands::AppCommand;
|
|
|
|
/// Central command sink. M2 replaces the body with real `AppRuntime`
|
|
/// dispatch; today it records that the typed-command path works.
|
|
fn dispatch(command: AppCommand) {
|
|
log::info!("[qbz-slint] AppCommand::{} dispatched", command.id());
|
|
}
|
|
|
|
fn main() -> Result<(), slint::PlatformError> {
|
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
|
|
|
|
let window = AppWindow::new()?;
|
|
|
|
window.on_sign_in_via_browser(|| dispatch(AppCommand::SignInViaBrowser));
|
|
window.on_use_system_browser(|| dispatch(AppCommand::UseSystemBrowser));
|
|
window.on_start_offline(|| dispatch(AppCommand::StartOffline));
|
|
window.on_open_tos(|| dispatch(AppCommand::OpenTermsOfService));
|
|
|
|
log::info!("[qbz-slint] window ready — login screen");
|
|
window.run()
|
|
}
|