Files
qbz/crates/qbz-ui/ui/foundation/typography.slint
T
vicrodh b7549790a3 feat: interface-size (UI scale) presets
Webview-zoom-style presets: Extra small 0.8 / Small 0.9 / Default 1.0 /
Large 1.2 / Extra large 1.5, applied through SLINT_SCALE_FACTOR set at
the top of main() before any thread or the backend exists. The env var
overrides the compositor DPR, so the value is last observed DPR x
preset; the Default preset leaves the var unset (stock DPR handling,
including live monitor changes, stays intact). last_dpr is persisted
from the winit window (real compositor DPR) on the 5s renderer-sentinel
timer.

- const-bake guard: strip SLINT_SCALE_FACTOR in qbz-ui build.rs so the
  slint compiler never bakes the factor into the generated code
- new UiScale global + scale-divided window minimums keep the physical
  minimum constant across presets (XL fits a 1366x768 screen); the
  three window-geometry gates in main.rs use the process-active factor
- artwork decode targets scale with the preset: sharp covers at >=1.2,
  smaller decoded-cache footprint below 1.0
- Settings > Appearance "Interface size" row below Language (replaces
  the commented-out percentage placeholder and its orphan properties),
  restart-to-apply toast
- Typography.boost = 1.1 on Extra small only, so body text stays
  readable at the 0.8 factor; Small (0.9) needs no compensation
- i18n: new strings added to all 7 locale catalogs

Known accepted limitation: slight text softness at fractional scale
factors (owner-accepted; diagnostic notes live in
qbz-nix-docs/ui-scale-presets/).

cc
2026-07-02 08:36:40 -06:00

29 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Typography scale — font sizes and weights.
export global Typography {
// Small-preset font compensation. The interface-size preset scales the
// whole window (SLINT_SCALE_FACTOR), so at Small (0.8) body text would
// drop to 12px — too small. Rust seeds `boost = 1.1` for that preset
// only (net body 15 × 0.8 × 1.1 ≈ 13.2px, readable); every other preset
// keeps 1.0. Layout metrics take the full 0.8 on purpose — the extra
// density is the point of Small.
in-out property <float> boost: 1.0;
out property <length> legal: 13px * boost;
out property <length> link: 14px * boost;
out property <length> body: 15px * boost;
out property <length> subtitle: 15px * boost;
out property <length> button: 17px * boost;
// Canonical page / section title — Home section headings ("New
// Releases", ...) and the hero titles on Album / Artist / Playlist
// / Mixtape detail pages. One size for all, for consistency.
out property <length> section: 18px * boost;
out property <length> heading: 19px * boost;
out property <length> title: 25px * boost;
out property <length> wordmark: 29px * boost;
out property <int> regular: 400;
out property <int> medium: 500;
out property <int> semibold: 600;
out property <int> bold: 700;
}