Stream name sits above strip and grid tiles with kind icon, person colour while audible
Browse files at this commitdd93b6cd85e8b686433e4ed2911e050d8e494c88Parent: 8fa2301- style
- stream name sits above strip and grid tiles with kind icon, person colour while audible
- share pill line only on real share audio (Waves::share_audible)
- friends icon Users
4 changed files +40 -33
- crates/client/src/gui/camera_view.rs +31 -30
- crates/client/src/gui/chat.rs +1 -1
- crates/client/src/gui/sidebar.rs +1 -1
- crates/client/src/gui/wave.rs +7 -1
crates/client/src/gui/camera_view.rsmodified+31 -30
| @@ -427,17 +427,12 @@ fn stage_tile( | ||
| 427 | 427 | let t = palette.tokens; |
| 428 | 428 | let entity = entity.clone(); |
| 429 | 429 | let focused = yumush.is_watching(user_id, kind); |
| 430 | - let speaking = yumush.chat.waves.speaking.contains(&user_id); | |
| 431 | 430 | let surface = yumush |
| 432 | 431 | .chat |
| 433 | 432 | .tiles |
| 434 | 433 | .get(&(user_id, kind)) |
| 435 | 434 | .filter(|tile| tile.shown) |
| 436 | 435 | .map(|tile| tile.surface.clone()); |
| 437 | - let name = yumush | |
| 438 | - .chat | |
| 439 | - .author(user_id) | |
| 440 | - .map_or_else(|| user_id.to_string(), |user| user.username.clone()); | |
| 441 | 436 | |
| 442 | 437 | div() |
| 443 | 438 | .id(format!("stage_{user_id}_{kind:?}")) |
| @@ -453,6 +448,7 @@ fn stage_tile( | ||
| 453 | 448 | yumush.toggle_viewer(user_id, kind, window, cx) |
| 454 | 449 | }); |
| 455 | 450 | }) |
| 451 | + .child(tile_name(yumush, (user_id, kind), focused, t)) | |
| 456 | 452 | .child( |
| 457 | 453 | div() |
| 458 | 454 | .h(px(TILE_H)) |
| @@ -461,15 +457,6 @@ fn stage_tile( | ||
| 461 | 457 | .bg(t.raise()) |
| 462 | 458 | .children(surface), |
| 463 | 459 | ) |
| 464 | - .child(tile_name( | |
| 465 | - name, | |
| 466 | - if speaking || focused { | |
| 467 | - Ink::Paper | |
| 468 | - } else { | |
| 469 | - Ink::Dim | |
| 470 | - }, | |
| 471 | - t, | |
| 472 | - )) | |
| 473 | 460 | } |
| 474 | 461 | |
| 475 | 462 | fn more_tile(entity: &Entity<Yumush>, more: usize, palette: Palette) -> impl IntoElement { |
| @@ -520,12 +507,6 @@ fn grid_cell( | ||
| 520 | 507 | .get(&(user_id, kind)) |
| 521 | 508 | .filter(|tile| tile.shown) |
| 522 | 509 | .map(|tile| tile.surface.clone()); |
| 523 | - let speaking = yumush.chat.waves.speaking.contains(&user_id); | |
| 524 | - let name = yumush | |
| 525 | - .chat | |
| 526 | - .author(user_id) | |
| 527 | - .map_or_else(|| user_id.to_string(), |user| user.username.clone()); | |
| 528 | - | |
| 529 | 510 | div() |
| 530 | 511 | .id(format!("grid_{user_id}_{kind:?}")) |
| 531 | 512 | .flex_1() |
| @@ -541,6 +522,7 @@ fn grid_cell( | ||
| 541 | 522 | yumush.toggle_viewer(user_id, kind, window, cx) |
| 542 | 523 | }); |
| 543 | 524 | }) |
| 525 | + .child(tile_name(yumush, (user_id, kind), false, t)) | |
| 544 | 526 | .child( |
| 545 | 527 | div() |
| 546 | 528 | .flex_1() |
| @@ -550,11 +532,6 @@ fn grid_cell( | ||
| 550 | 532 | .bg(t.raise()) |
| 551 | 533 | .children(surface), |
| 552 | 534 | ) |
| 553 | - .child(tile_name( | |
| 554 | - name, | |
| 555 | - if speaking { Ink::Paper } else { Ink::Dim }, | |
| 556 | - t, | |
| 557 | - )) | |
| 558 | 535 | .into_any_element() |
| 559 | 536 | } |
| 560 | 537 | |
| @@ -577,10 +554,34 @@ pub(super) fn tile_label(yumush: &Yumush, palette: Palette, (user_id, _): (Id, K | ||
| 577 | 554 | .children(muted.then(|| super::parts::small_icon(IconName::MicOff).text_color(t.bad()))) |
| 578 | 555 | } |
| 579 | 556 | |
| 580 | -fn tile_name(name: impl Into<gpui_kit::SharedString>, ink: Ink, t: super::style::Tokens) -> Div { | |
| 581 | - div() | |
| 557 | +fn tile_name( | |
| 558 | + yumush: &Yumush, | |
| 559 | + (user_id, kind): (Id, Kind), | |
| 560 | + focused: bool, | |
| 561 | + t: super::style::Tokens, | |
| 562 | +) -> Div { | |
| 563 | + let name = yumush | |
| 564 | + .chat | |
| 565 | + .author(user_id) | |
| 566 | + .map_or_else(|| user_id.to_string(), |user| user.username.clone()); | |
| 567 | + let audible = yumush.chat.waves.audible(user_id); | |
| 568 | + let ink = if audible || focused { | |
| 569 | + Ink::Paper | |
| 570 | + } else { | |
| 571 | + Ink::Dim | |
| 572 | + }; | |
| 573 | + super::parts::band(space::XS) | |
| 582 | 574 | .h(px(size::ICON)) |
| 583 | - .flex() | |
| 584 | - .items_center() | |
| 585 | - .child(words(name, Text::Label, ink, t)) | |
| 575 | + .child( | |
| 576 | + super::parts::small_icon(match kind { | |
| 577 | + Kind::Camera => IconName::Video, | |
| 578 | + Kind::Screen => IconName::ScreenShare, | |
| 579 | + }) | |
| 580 | + .text_color(if audible { t.person(user_id) } else { t.dim() }), | |
| 581 | + ) | |
| 582 | + .child( | |
| 583 | + words(name, Text::Label, ink, t) | |
| 584 | + .truncate() | |
| 585 | + .when(audible, |name| name.text_color(t.person(user_id))), | |
| 586 | + ) | |
| 586 | 587 | } |
crates/client/src/gui/chat.rsmodified+1 -1
| @@ -3005,7 +3005,7 @@ fn members_column( | ||
| 3005 | 3005 | user.id, |
| 3006 | 3006 | kind, |
| 3007 | 3007 | yumush.is_watching(user.id, kind), |
| 3008 | - (kind == Kind::Screen) | |
| 3008 | + (kind == Kind::Screen && chat.waves.share_audible(user.id)) | |
| 3009 | 3009 | .then(|| chat.waves.share(user.id)) |
| 3010 | 3010 | .flatten(), |
| 3011 | 3011 | palette, |
crates/client/src/gui/sidebar.rsmodified+1 -1
| @@ -398,7 +398,7 @@ impl Yumush { | ||
| 398 | 398 | .justify_center() |
| 399 | 399 | .rounded_full() |
| 400 | 400 | .text_color(palette.muted) |
| 401 | - .child(super::parts::small_icon(IconName::UserRoundCheck)) | |
| 401 | + .child(super::parts::small_icon(IconName::Users)) | |
| 402 | 402 | .children(alert.then(|| { |
| 403 | 403 | div() |
| 404 | 404 | .absolute() |
crates/client/src/gui/wave.rsmodified+7 -1
| @@ -139,7 +139,13 @@ impl Waves { | ||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | pub fn audible(&self, id: Id) -> bool { |
| 142 | - self.speaking.contains(&id) || self.share.contains_key(&id) | |
| 142 | + self.speaking.contains(&id) || self.share_audible(id) | |
| 143 | + } | |
| 144 | + | |
| 145 | + pub fn share_audible(&self, id: Id) -> bool { | |
| 146 | + self.share | |
| 147 | + .get(&id) | |
| 148 | + .is_some_and(|wave| wave.bars.iter().any(|bar| *bar >= GONE)) | |
| 143 | 149 | } |
| 144 | 150 | |
| 145 | 151 | pub fn share(&self, id: Id) -> Option<&VecDeque<f32>> { |