forge
Explore
Log in

Don't you dare go Hollow

Join voice is one pill below the In voice list (or alone when empty)

Browse files at this commit

4d11f0d95a6283428cc1c5d39e3e1609129579fcAhmet Kaan GümüşParent: 03cece2
  • style
    • join voice is one pill below the In voice list (or alone when empty)
    • section header no longer carries an action
Show full message
💄 style: join voice is one pill below the In voice list (or alone when empty); section header no longer carries an action
crates/client/src/gui/chat.rsmodified+14 -29
@@ -3181,10 +3181,7 @@ fn members_column(
3181 .children(watch(Kind::Camera))3181 .children(watch(Kind::Camera))
3182 .children(watch(Kind::Screen))3182 .children(watch(Kind::Screen))
3183 };3183 };
3184- let section = |title: &'static str,3184+ let section = |title: &'static str, rows: Vec<&MemberRow>, cap: usize| {
3185- rows: Vec<&MemberRow>,
3186- cap: usize,
3187- action: Option<gpui_kit::Stateful<Div>>| {
3188 (!rows.is_empty()).then(|| {3185 (!rows.is_empty()).then(|| {
3189 let total = rows.len();3186 let total = rows.len();
3190 let more = total.saturating_sub(cap);3187 let more = total.saturating_sub(cap);
@@ -3193,11 +3190,7 @@ fn members_column(
3193 .flex_col()3190 .flex_col()
3194 .child(3191 .child(
3195 super::parts::caption_head(format!("{title} · {total}"), palette.tokens)3192 super::parts::caption_head(format!("{title} · {total}"), palette.tokens)
3196- .pb(px(space::XS))3193+ .pb(px(space::XS)),
3197- .flex()
3198- .items_center()
3199- .justify_between()
3200- .children(action),
3201 )3194 )
3202 .children(rows.into_iter().take(cap).map(row))3195 .children(rows.into_iter().take(cap).map(row))
3203 .when(more > 0, |this| {3196 .when(more > 0, |this| {
@@ -3228,24 +3221,22 @@ fn members_column(
3228 let action = entity_action(&entity, move |yumush, window, cx| {3221 let action = entity_action(&entity, move |yumush, window, cx| {
3229 yumush.toggle_voice(community_id, window, cx)3222 yumush.toggle_voice(community_id, window, cx)
3230 });3223 });
3231- let empty = in_call.is_empty();3224+ super::parts::pill("margin_join", palette.tokens, action)
3232- let pill = super::parts::pill("margin_join", palette.tokens, action)
3233 .self_start()3225 .self_start()
3234 .gap(px(space::SM))3226 .gap(px(space::SM))
3235 .text_color(palette.tokens.ground())3227 .text_color(palette.tokens.ground())
3236 .font_weight(FontWeight::SEMIBOLD)3228 .font_weight(FontWeight::SEMIBOLD)
3237- .child(super::parts::small_icon(IconName::Headphones));3229+ .child(super::parts::small_icon(IconName::Headphones))
3238- if empty {3230+ .child(w().chat.join_voice)
3239- pill.child(w().chat.join_voice)3231+ });
3240- } else {3232+ let call = (!in_call.is_empty() || join.is_some()).then(|| {
3241- pill.h(px(size::CHIP)).px(px(space::SM)).child(w().chat.join)3233+ div()
3242- }3234+ .flex()
3235+ .flex_col()
3236+ .gap(px(space::SM))
3237+ .children(section(w().chat.in_voice, in_call, usize::MAX))
3238+ .children(join)
3243 });3239 });
3244- let call = if in_call.is_empty() {
3245- join.map(|join| div().child(join))
3246- } else {
3247- section(w().chat.in_voice, in_call, usize::MAX, join)
3248- };
3249 let online = members3240 let online = members
3250 .iter()3241 .iter()
3251 .filter(|row| !row.in_voice && row.presence != Presence::Offline)3242 .filter(|row| !row.in_voice && row.presence != Presence::Offline)
@@ -3266,12 +3257,7 @@ fn members_column(
3266 .gap(px(space::LG))3257 .gap(px(space::LG))
3267 .child(room_head(yumush, palette))3258 .child(room_head(yumush, palette))
3268 .children(call)3259 .children(call)
3269- .children(section(3260+ .children(section(w().common.presence_online, online, usize::MAX))
3270- w().common.presence_online,
3271- online,
3272- usize::MAX,
3273- None,
3274- ))
3275 .children(section(3261 .children(section(
3276 w().common.presence_offline,3262 w().common.presence_offline,
3277 offline,3263 offline,
@@ -3280,7 +3266,6 @@ fn members_column(
3280 } else {3266 } else {
3281 OFFLINE3267 OFFLINE
3282 },3268 },
3283- None,
3284 )),3269 )),
3285 )3270 )
3286 }3271 }