Slint basics
Taunus draws every screen with Slint, a declarative UI language compiled into Rust. You
write the UI in .slint files and the logic in Rust; they talk through properties, callbacks and globals.
Read Slint's own documentation for the language:
- Slint documentation — the language, elements, layouts, animations
- Rust API —
ComponentHandle, models, timers,invoke_from_event_loop - Slint tutorial
Taunus uses Slint 1.x (the version pinned in the root Cargo.toml); look at the matching version of the docs.
What Taunus adds
| Instead of… | Use… | Why |
|---|---|---|
std-widgets.slint | @taunus/index.slint | The Taunus look, both form factors, the focus engine |
| colours and sizes in the code | Theme tokens | They follow the wallpaper, the text size and the form factor |
a bare TouchArea as a button | Tappable, Button, ListRow | A bare TouchArea can't be reached by remote or keyboard |
"text" | @tr("key") | Translations |
PopupWindow | Popup, Dialog, Menu | Focus trap, Back, safe area |
Patterns used across the apps
- One global per app (
export global Hello { … }) holds the state Rust sets and the callbacks Rust handles. Pages read it directly, so no properties have to be passed through every component. - Rust owns the state. The UI shows it and reports what the user did; it never keeps the only copy.
- Work off the UI thread. Anything slow (D-Bus, sockets, files, the network) runs on a thread and comes back
with
weak.upgrade_in_event_loop(…)orslint::invoke_from_event_loop(…). - Models (
VecModelin anRc) for lists: change the rows in place instead of setting a new model, so the list keeps its scroll position and focus.