Move the view models into voelin-ui-vm; the Slint models take plain rows
vm/{avatar,tree,servers,streams,home,chat,social,studio} and the UI
settings (settings.rs: keys, UiSettings, LastVoice, ClientPlaybackMap,
the audio form) move into voelin-ui-vm with their tests (102 there now;
the 86 view-model tests of voelin-ui all survive, the old list::sync test
became the list::diff tests). They produce the plain bridge structs, with
Rgb for colours and ImageRef for pictures:
- a file picture is ImageSource::File { path, stamp }: the engine writes
a picture that arrives again into the same file, so the length and
write time are part of the reference and a changed file redraws its
row; size() reads the header once per stamp (no toolkit decoder);
- pictures held in memory (chat previews) are ImageSource::Memory;
- the line cache of the chat no longer keeps Slint models alive for
pointer equality: plain lines compare by value, so an unchanged
message makes the same line with or without the cache.
voelin-ui keeps every model as bind::rows::Rows<T>: the plain rows last
shown plus the VecModel, synced with list::diff, converting only the rows
that changed (bind/convert has the From impls). The controllers hand the
view-model rows to Rows::sync and convert forms at the bridge
(`.into()`); crate::vm is now `voelin_ui_vm as vm`, so paths stay.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8e6838a00f
commit
ce7ec3afb7
41 files changed
+1154
-780
No files matched your search
@@ -52,13 +52,13 @@ pub(crate) fn wire(bridge: &StudioBridge) {
|
||||
with_app(|app| app.studio_add_picked(index(i)));
|
||||
});
|
||||
bridge.on_add_source(|form| {
|
||||
with_app(|app| app.studio_add_source(&form));
|
||||
with_app(|app| app.studio_add_source(&form.into()));
|
||||
});
|
||||
bridge.on_source_form(|source| {
|
||||
with_app(|app| app.studio_source_form(id(source))).unwrap_or_default()
|
||||
with_app(|app| app.studio_source_form(id(source))).unwrap_or_default().into()
|
||||
});
|
||||
bridge.on_apply_source(|form| {
|
||||
with_app(|app| app.studio_apply_source(&form));
|
||||
with_app(|app| app.studio_apply_source(&form.into()));
|
||||
});
|
||||
bridge.on_toggle_source(|source| {
|
||||
with_app(|app| app.studio_toggle_source(id(source)));
|
||||
@@ -93,7 +93,7 @@ pub(crate) fn wire(bridge: &StudioBridge) {
|
||||
with_app(|app| app.studio_set_output(&w, &h, &fps));
|
||||
});
|
||||
bridge.on_set_layer(|i, layer| {
|
||||
with_app(|app| app.studio_set_layer(index(i), &layer));
|
||||
with_app(|app| app.studio_set_layer(index(i), &layer.into()));
|
||||
});
|
||||
bridge.on_add_layer(|| {
|
||||
with_app(|app| app.studio_add_layer());
|
||||
@@ -120,9 +120,10 @@ pub(crate) fn wire(bridge: &StudioBridge) {
|
||||
bridge.on_end_stream(|| {
|
||||
with_app(|app| app.studio_end());
|
||||
});
|
||||
bridge.on_settings_form(|| with_app(|app| app.studio_settings_form()).unwrap_or_default());
|
||||
bridge
|
||||
.on_settings_form(|| with_app(|app| app.studio_settings_form()).unwrap_or_default().into());
|
||||
bridge.on_apply_settings(|form| {
|
||||
with_app(|app| app.studio_apply_settings(&form));
|
||||
with_app(|app| app.studio_apply_settings(&form.into()));
|
||||
});
|
||||
|
||||
bridge.on_respond_viewer(|client, accept| {
|
||||
|
||||
Reference in new issue
Block a user