voelin-gpui: the tree marks who talks again, the ring on the avatar and the bars on the row
The gate ruled for parity: the tree cleared `talking` on every row to keep its pane from being drawn with each start and stop of someone's voice, and the Slint tree (channels.slint) has the speaking ring on the avatar and the bars on the row. The model keeps the flag now and client_row draws the ring (Avatar::speaking) and the bars, 14 pixels as SpeakingBars is, after the badges and before the LIVE mark, as the Slint row orders them. The cost was measured with the meter at 10 starts and stops a second (the sample server, release build, lavapipe on Xvfb :231): the tree pane is rendered once for each, 9.97 a second for 9.97 events, as the members panel is, and the rail, the top bar and the main area not at all; 102 % of a core in all, 5.0 % of it GPUI's thread, which is what the run before the change had (3.1 % to 5.0 %). docs/ui.md replaces the paragraph that said the tree carries no talking with the figure; the tests that counted the tree as not drawn count it as drawn once (a talker changes one row and draws the tree once; the tree and the members panel and no other pane), and the sample server's tree marks Kairo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b01e25391
commit
122b2d29fa
6 files changed
+100
-52
No files matched your search
@@ -29,7 +29,7 @@ use super::actions::{
|
||||
EditChannel, JoinChannel, MoveClient, OpenClient, OpenMember, SelectChannel, ToggleChannel,
|
||||
};
|
||||
use super::tree_model::{Emptiness, TreeEvent, TreeModel, debug_check};
|
||||
use super::widgets::{Avatar, banner_scrim, icon, live_badge, small_picture};
|
||||
use super::widgets::{Avatar, banner_scrim, icon, live_badge, small_picture, speaking_bars};
|
||||
use crate::meter::Counters;
|
||||
use crate::pictures::{PictureKey, picture};
|
||||
use crate::theme::{VoelinTheme, hsla};
|
||||
@@ -336,7 +336,8 @@ fn client_row(theme: &VoelinTheme, item: &TreeItem) -> AnyElement {
|
||||
.gap(px(m.space_3))
|
||||
.child(
|
||||
Avatar::new(("tree-avatar", id), 22.0, &item.initials, item.tint)
|
||||
.image(item.avatar.clone()),
|
||||
.image(item.avatar.clone())
|
||||
.speaking(item.talking),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
@@ -355,6 +356,16 @@ fn client_row(theme: &VoelinTheme, item: &TreeItem) -> AnyElement {
|
||||
.filter_map(|badge| small_picture(badge, 14.0)),
|
||||
),
|
||||
)
|
||||
// The Slint bars move; these stand still (nothing here draws the window
|
||||
// anew with the clock).
|
||||
.when(item.talking, |row| {
|
||||
row.child(
|
||||
div()
|
||||
.debug_selector(move || format!("tree-speaking-{id}"))
|
||||
.flex_none()
|
||||
.child(speaking_bars(theme, 14.0)),
|
||||
)
|
||||
})
|
||||
.when(item.streaming, |row| row.child(live_badge(theme)))
|
||||
.when(item.local_muted, |row| row.child(mark("volume-x", c.warning)))
|
||||
.when(!item.local_muted && item.local_volume != 100, |row| {
|
||||
|
||||
Reference in new issue
Block a user