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(
31813181 .children(watch(Kind::Camera))
31823182 .children(watch(Kind::Screen))
31833183 };
3184- let section = |title: &'static str,
3185- rows: Vec<&MemberRow>,
3186- cap: usize,
3187- action: Option<gpui_kit::Stateful<Div>>| {
3184+ let section = |title: &'static str, rows: Vec<&MemberRow>, cap: usize| {
31883185 (!rows.is_empty()).then(|| {
31893186 let total = rows.len();
31903187 let more = total.saturating_sub(cap);
@@ -3193,11 +3190,7 @@ fn members_column(
31933190 .flex_col()
31943191 .child(
31953192 super::parts::caption_head(format!("{title} · {total}"), palette.tokens)
3196- .pb(px(space::XS))
3197- .flex()
3198- .items_center()
3199- .justify_between()
3200- .children(action),
3193+ .pb(px(space::XS)),
32013194 )
32023195 .children(rows.into_iter().take(cap).map(row))
32033196 .when(more > 0, |this| {
@@ -3228,24 +3221,22 @@ fn members_column(
32283221 let action = entity_action(&entity, move |yumush, window, cx| {
32293222 yumush.toggle_voice(community_id, window, cx)
32303223 });
3231- let empty = in_call.is_empty();
3232- let pill = super::parts::pill("margin_join", palette.tokens, action)
3224+ super::parts::pill("margin_join", palette.tokens, action)
32333225 .self_start()
32343226 .gap(px(space::SM))
32353227 .text_color(palette.tokens.ground())
32363228 .font_weight(FontWeight::SEMIBOLD)
3237- .child(super::parts::small_icon(IconName::Headphones));
3238- if empty {
3239- pill.child(w().chat.join_voice)
3240- } else {
3241- pill.h(px(size::CHIP)).px(px(space::SM)).child(w().chat.join)
3242- }
3229+ .child(super::parts::small_icon(IconName::Headphones))
3230+ .child(w().chat.join_voice)
3231+ });
3232+ let call = (!in_call.is_empty() || join.is_some()).then(|| {
3233+ div()
3234+ .flex()
3235+ .flex_col()
3236+ .gap(px(space::SM))
3237+ .children(section(w().chat.in_voice, in_call, usize::MAX))
3238+ .children(join)
32433239 });
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- };
32493240 let online = members
32503241 .iter()
32513242 .filter(|row| !row.in_voice && row.presence != Presence::Offline)
@@ -3266,12 +3257,7 @@ fn members_column(
32663257 .gap(px(space::LG))
32673258 .child(room_head(yumush, palette))
32683259 .children(call)
3269- .children(section(
3270- w().common.presence_online,
3271- online,
3272- usize::MAX,
3273- None,
3274- ))
3260+ .children(section(w().common.presence_online, online, usize::MAX))
32753261 .children(section(
32763262 w().common.presence_offline,
32773263 offline,
@@ -3280,7 +3266,6 @@ fn members_column(
32803266 } else {
32813267 OFFLINE
32823268 },
3283- None,
32843269 )),
32853270 )
32863271 }