Files
qbz/crates/qbz-slint/ui/primitives/QbzCheckbox.slint
T
vicrodh d5be0029b6 feat(qbz-slint): foundation tokens and login screen
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
2026-05-18 12:13:52 -06:00

34 lines
831 B
Plaintext

// Small square checkbox primitive matching the QBZ dark theme.
import { Theme } from "../foundation/semantic-colors.slint";
export component QbzCheckbox inherits Rectangle {
in-out property <bool> checked: false;
callback toggled();
width: 18px;
height: 18px;
border-radius: 4px;
background: root.checked ? Theme.accent : transparent;
border-width: root.checked ? 0px : 1.5px;
border-color: Theme.text-muted;
Text {
text: "✓";
visible: root.checked;
color: Theme.accent-text;
font-size: 13px;
font-weight: 700;
horizontal-alignment: center;
vertical-alignment: center;
}
TouchArea {
mouse-cursor: pointer;
clicked => {
root.checked = !root.checked;
root.toggled();
}
}
}