The single 1700-line app.slint becomes a design system and screens that later waves can compose: - theme.slint: colour, radius, spacing and type tokens (dark and light, a runtime font scale); icons.slint: Lucide icons as tintable images. - components/: Button, IconButton, TextField, SearchBox, Select, Toggle, Slider, SegmentedTabs, Avatar, badges, Card, Meter, NavItem, ListItem, PopupMenu, Tooltip, Modal, Toast, ResizeHandle, Spinner, RichText and the EmojiPicker. - shells/: the desktop frame (server rail, top bar, sidebar with the user card) and the phone frame with a bottom navigation, switched at a breakpoint from the settings. - screens/: today's screens re-skinned (channels, chat, streams panel and viewer, settings page, home, dialogs, phone pages); all callbacks and properties keep their behaviour. Navigation state is the Nav global. On the Rust side app.rs keeps setup and event glue; servers.rs, chat.rs, settings_page.rs and appearance.rs hold the logic, vm/ the pure view models, bind/ the callbacks, dev.rs the development switches. Models are created once and updated row by row (vm::list::sync); each chat tab owns its lines model, so a message appends one row. Emoji come from the bundled Twemoji archive through a size-bounded image cache, split into runs that wrap with the text. New settings ui.theme, ui.font_scale, ui.narrow_breakpoint and ui.image_cache_mb apply live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
20 lines
399 B
Rust
20 lines
399 B
Rust
//! Callbacks of the screens, wired to the app. One module per screen or
|
|
//! area; each has a `wire` that the window calls once.
|
|
|
|
mod chat;
|
|
mod emoji;
|
|
mod servers;
|
|
mod settings;
|
|
mod streams;
|
|
|
|
use crate::app::MainWindow;
|
|
|
|
/// Connect every callback of the window.
|
|
pub(crate) fn wire(ui: &MainWindow) {
|
|
servers::wire(ui);
|
|
chat::wire(ui);
|
|
streams::wire(ui);
|
|
settings::wire(ui);
|
|
emoji::wire(ui);
|
|
}
|