Empty-room join voice is the primary pill (filled, headphones + label) so it reads as an action, not a member row
Browse files at this commit5ca3aa593a12b91f505bb1dea04d887f309b704cParent: 3056710- style
- empty-room join voice is the primary pill (filled, headphones + label) so it reads as an action, not a member row
1 changed file +22 -27
- crates/client/src/gui/chat.rs +22 -27
crates/client/src/gui/chat.rsmodified+22 -27
| @@ -3225,33 +3225,28 @@ fn members_column( | ||
| 3225 | 3225 | }; |
| 3226 | 3226 | let in_call: Vec<&MemberRow> = members.iter().filter(|row| row.in_voice).collect(); |
| 3227 | 3227 | let join = (!chat.in_voice(community_id) && yumush.can_join_voice(community_id)).then(|| { |
| 3228 | - let empty = in_call.is_empty(); | |
| 3229 | - clickable( | |
| 3230 | - "margin_join", | |
| 3231 | - palette, | |
| 3232 | - entity_action(&entity, move |yumush, window, cx| { | |
| 3233 | - yumush.toggle_voice(community_id, window, cx) | |
| 3234 | - }), | |
| 3235 | - ) | |
| 3236 | - .h(px(if empty { size::CONTROL } else { size::CHIP })) | |
| 3237 | - .px(px(if empty { space::SM } else { space::XS })) | |
| 3238 | - .flex() | |
| 3239 | - .items_center() | |
| 3240 | - .gap(px(space::SM)) | |
| 3241 | - .rounded(px(radius::MD)) | |
| 3242 | - .text_color(palette.accent) | |
| 3243 | - .child( | |
| 3244 | - div() | |
| 3245 | - .w(px(if empty { size::ICON } else { size::ICON_SM })) | |
| 3246 | - .flex() | |
| 3247 | - .justify_center() | |
| 3248 | - .child(super::parts::small_icon(IconName::Headphones)), | |
| 3249 | - ) | |
| 3250 | - .child(if empty { | |
| 3251 | - w().chat.join_voice | |
| 3252 | - } else { | |
| 3253 | - w().chat.join | |
| 3254 | - }) | |
| 3228 | + let action = entity_action(&entity, move |yumush, window, cx| { | |
| 3229 | + yumush.toggle_voice(community_id, window, cx) | |
| 3230 | + }); | |
| 3231 | + if in_call.is_empty() { | |
| 3232 | + return super::parts::pill("margin_join", palette.tokens, action) | |
| 3233 | + .self_start() | |
| 3234 | + .gap(px(space::SM)) | |
| 3235 | + .text_color(palette.tokens.ground()) | |
| 3236 | + .font_weight(FontWeight::SEMIBOLD) | |
| 3237 | + .child(super::parts::small_icon(IconName::Headphones)) | |
| 3238 | + .child(w().chat.join_voice); | |
| 3239 | + } | |
| 3240 | + clickable("margin_join", palette, action) | |
| 3241 | + .h(px(size::CHIP)) | |
| 3242 | + .px(px(space::XS)) | |
| 3243 | + .flex() | |
| 3244 | + .items_center() | |
| 3245 | + .gap(px(space::SM)) | |
| 3246 | + .rounded(px(radius::MD)) | |
| 3247 | + .text_color(palette.accent) | |
| 3248 | + .child(super::parts::small_icon(IconName::Headphones)) | |
| 3249 | + .child(w().chat.join) | |
| 3255 | 3250 | }); |
| 3256 | 3251 | let call = if in_call.is_empty() { |
| 3257 | 3252 | join.map(|join| div().child(join)) |