Drop the top voice strip (In call margin carries it)
Browse files at this commit8fa2301ab734f2019156212740c20ef75a3dcc2dParent: 0f0df08- style
- drop the top voice strip (In call margin carries it)
- screen pill draws share audio
- right margin widened to size::MARGIN 280
4 changed files +38 -68
- crates/client/design/tokens.toml +1 -0
- crates/client/src/gui/camera_view.rs +22 -67
- crates/client/src/gui/chat.rs +4 -1
- crates/client/src/gui/sidebar.rs +11 -0
crates/client/design/tokens.tomlmodified+1 -0
| @@ -69,6 +69,7 @@ rail = 56 | |||
| 69 | avatar_lg = 64 | 69 | avatar_lg = 64 |
| 70 | thumb = 120 | 70 | thumb = 120 |
| 71 | sidebar = 230 | 71 | sidebar = 230 |
| 72 | +margin = 280 | ||
| 72 | index = 200 | 73 | index = 200 |
| 73 | talk = 300 | 74 | talk = 300 |
| 74 | popover = 300 | 75 | popover = 300 |
crates/client/src/gui/camera_view.rsmodified+22 -67
| @@ -214,7 +214,7 @@ impl Yumush { | |||
| 214 | ) -> Option<impl IntoElement> { | 214 | ) -> Option<impl IntoElement> { |
| 215 | let shown = match self.chat.stage { | 215 | let shown = match self.chat.stage { |
| 216 | Stage::Strip => true, | 216 | Stage::Strip => true, |
| 217 | - Stage::Grid => self.chat.viewer.is_some() || self.stage_sources().is_empty(), | 217 | + Stage::Grid => self.chat.viewer.is_some(), |
| 218 | Stage::Hidden => false, | 218 | Stage::Hidden => false, |
| 219 | }; | 219 | }; |
| 220 | if !shown || !self.in_stage_chat() { | 220 | if !shown || !self.in_stage_chat() { |
| @@ -239,24 +239,7 @@ impl Yumush { | |||
| 239 | .children((more > 0).then(|| more_tile(entity, more, palette).into_any_element())) | 239 | .children((more > 0).then(|| more_tile(entity, more, palette).into_any_element())) |
| 240 | }); | 240 | }); |
| 241 | 241 | ||
| 242 | - Some( | 242 | + strip |
| 243 | - div() | ||
| 244 | - .flex() | ||
| 245 | - .flex_col() | ||
| 246 | - .flex_shrink_0() | ||
| 247 | - .child(self.voices(palette)) | ||
| 248 | - .children(strip), | ||
| 249 | - ) | ||
| 250 | - } | ||
| 251 | - | ||
| 252 | - fn voices(&self, palette: Palette) -> Div { | ||
| 253 | - let ids = self | ||
| 254 | - .chat | ||
| 255 | - .voice_community() | ||
| 256 | - .map(|community_id| self.chat.voice_ids(community_id).to_vec()) | ||
| 257 | - .unwrap_or_default(); | ||
| 258 | - let others: Vec<Id> = ids.into_iter().filter(|id| !self.is_me(*id)).collect(); | ||
| 259 | - self.voices_of(&others, palette) | ||
| 260 | } | 243 | } |
| 261 | 244 | ||
| 262 | fn slots(&self, ids: &[Id]) -> (Vec<Id>, usize) { | 245 | fn slots(&self, ids: &[Id]) -> (Vec<Id>, usize) { |
| @@ -318,21 +301,6 @@ impl Yumush { | |||
| 318 | .collect() | 301 | .collect() |
| 319 | } | 302 | } |
| 320 | 303 | ||
| 321 | - fn voices_of(&self, ids: &[Id], palette: Palette) -> Div { | ||
| 322 | - div() | ||
| 323 | - .flex() | ||
| 324 | - .flex_col() | ||
| 325 | - .flex_shrink_0() | ||
| 326 | - .gap(px(space::MD)) | ||
| 327 | - .px(px(space::XL)) | ||
| 328 | - .py(px(space::XL)) | ||
| 329 | - .children( | ||
| 330 | - self.voice_captions(ids, palette) | ||
| 331 | - .into_iter() | ||
| 332 | - .map(|caption| caption.w_full()), | ||
| 333 | - ) | ||
| 334 | - } | ||
| 335 | - | ||
| 336 | pub(super) fn voice_band(&self, palette: Palette) -> Div { | 304 | pub(super) fn voice_band(&self, palette: Palette) -> Div { |
| 337 | let ids = self | 305 | let ids = self |
| 338 | .chat | 306 | .chat |
| @@ -367,18 +335,11 @@ impl Yumush { | |||
| 367 | { | 335 | { |
| 368 | return None; | 336 | return None; |
| 369 | } | 337 | } |
| 370 | - let community_id = self.chat.voice_community()?; | 338 | + self.chat.voice_community()?; |
| 371 | let sources = self.stage_sources(); | 339 | let sources = self.stage_sources(); |
| 372 | if sources.is_empty() { | 340 | if sources.is_empty() { |
| 373 | return None; | 341 | return None; |
| 374 | } | 342 | } |
| 375 | - let quiet: Vec<Id> = self | ||
| 376 | - .chat | ||
| 377 | - .voice_ids(community_id) | ||
| 378 | - .iter() | ||
| 379 | - .filter(|id| !sources.contains(&(**id, Kind::Camera)) && !self.is_me(**id)) | ||
| 380 | - .copied() | ||
| 381 | - .collect(); | ||
| 382 | let columns = ((sources.len() as f32).sqrt().ceil() as usize).max(1); | 343 | let columns = ((sources.len() as f32).sqrt().ceil() as usize).max(1); |
| 383 | let rows = sources.len().div_ceil(columns); | 344 | let rows = sources.len().div_ceil(columns); |
| 384 | let mut cells = sources | 345 | let mut cells = sources |
| @@ -386,31 +347,25 @@ impl Yumush { | |||
| 386 | .map(|source| grid_cell(entity, self, palette, source)); | 347 | .map(|source| grid_cell(entity, self, palette, source)); |
| 387 | 348 | ||
| 388 | Some( | 349 | Some( |
| 389 | - div() | 350 | + div().flex_1().min_h_0().flex().flex_col().child( |
| 390 | - .flex_1() | 351 | + div() |
| 391 | - .min_h_0() | 352 | + .flex_1() |
| 392 | - .flex() | 353 | + .min_h_0() |
| 393 | - .flex_col() | 354 | + .px(px(space::XL)) |
| 394 | - .child( | 355 | + .pt(px(space::XL)) |
| 395 | - div() | 356 | + .flex() |
| 396 | - .flex_1() | 357 | + .flex_col() |
| 397 | - .min_h_0() | 358 | + .gap(px(space::LG)) |
| 398 | - .px(px(space::XL)) | 359 | + .children((0..rows).map(|_| { |
| 399 | - .pt(px(space::XL)) | 360 | + div().flex_1().min_h_0().flex().gap(px(space::LG)).children( |
| 400 | - .flex() | 361 | + (0..columns).map(|_| { |
| 401 | - .flex_col() | 362 | + cells |
| 402 | - .gap(px(space::LG)) | 363 | + .next() |
| 403 | - .children((0..rows).map(|_| { | 364 | + .unwrap_or_else(|| div().flex_1().into_any_element()) |
| 404 | - div().flex_1().min_h_0().flex().gap(px(space::LG)).children( | 365 | + }), |
| 405 | - (0..columns).map(|_| { | 366 | + ) |
| 406 | - cells | 367 | + })), |
| 407 | - .next() | 368 | + ), |
| 408 | - .unwrap_or_else(|| div().flex_1().into_any_element()) | ||
| 409 | - }), | ||
| 410 | - ) | ||
| 411 | - })), | ||
| 412 | - ) | ||
| 413 | - .child(self.voices_of(&quiet, palette)), | ||
| 414 | ) | 369 | ) |
| 415 | } | 370 | } |
| 416 | } | 371 | } |
crates/client/src/gui/chat.rsmodified+4 -1
| @@ -3005,6 +3005,9 @@ fn members_column( | |||
| 3005 | user.id, | 3005 | user.id, |
| 3006 | kind, | 3006 | kind, |
| 3007 | yumush.is_watching(user.id, kind), | 3007 | yumush.is_watching(user.id, kind), |
| 3008 | + (kind == Kind::Screen) | ||
| 3009 | + .then(|| chat.waves.share(user.id)) | ||
| 3010 | + .flatten(), | ||
| 3008 | palette, | 3011 | palette, |
| 3009 | ) | 3012 | ) |
| 3010 | }) | 3013 | }) |
| @@ -3186,7 +3189,7 @@ fn members_column( | |||
| 3186 | Some( | 3189 | Some( |
| 3187 | div() | 3190 | div() |
| 3188 | .id("members_column") | 3191 | .id("members_column") |
| 3189 | - .w(px(size::SIDEBAR)) | 3192 | + .w(px(size::MARGIN)) |
| 3190 | .flex_none() | 3193 | .flex_none() |
| 3191 | .h_full() | 3194 | .h_full() |
| 3192 | .overflow_y_scroll() | 3195 | .overflow_y_scroll() |
crates/client/src/gui/sidebar.rsmodified+11 -0
| @@ -992,6 +992,7 @@ pub(super) fn watch_pill( | |||
| 992 | user_id: Id, | 992 | user_id: Id, |
| 993 | kind: Kind, | 993 | kind: Kind, |
| 994 | watching: bool, | 994 | watching: bool, |
| 995 | + audio: Option<&std::collections::VecDeque<f32>>, | ||
| 995 | palette: Palette, | 996 | palette: Palette, |
| 996 | ) -> impl IntoElement { | 997 | ) -> impl IntoElement { |
| 997 | let icon = match kind { | 998 | let icon = match kind { |
| @@ -1017,6 +1018,16 @@ pub(super) fn watch_pill( | |||
| 1017 | .items_center() | 1018 | .items_center() |
| 1018 | .gap(px(space::XS)) | 1019 | .gap(px(space::XS)) |
| 1019 | .rounded(px(radius::SM)) | 1020 | .rounded(px(radius::SM)) |
| 1021 | + .children(audio.map(|audio| { | ||
| 1022 | + div() | ||
| 1023 | + .w(px(size::CONTROL)) | ||
| 1024 | + .h(px(space::LG)) | ||
| 1025 | + .child(super::parts::voice_line( | ||
| 1026 | + Some(audio), | ||
| 1027 | + super::parts::Voice::Live(palette.tokens.person(user_id)), | ||
| 1028 | + palette.tokens, | ||
| 1029 | + )) | ||
| 1030 | + })) | ||
| 1020 | .child(super::parts::small_icon(icon).text_color(if watching { | 1031 | .child(super::parts::small_icon(icon).text_color(if watching { |
| 1021 | palette.text | 1032 | palette.text |
| 1022 | } else { | 1033 | } else { |