Aligned voice rows, strip/grid switch in header, viewer control bar, poll voters list
Browse files at this commitf296e6e1cc4597474b04cb51ae0f108dae395366Parent: 05ce84c- style
- aligned voice rows, strip/grid switch in header, viewer control bar, poll voters list
5 changed files +261 -154
- crates/client/src/gui/camera_view.rs +3 -37
- crates/client/src/gui/chat.rs +58 -25
- crates/client/src/gui/poll.rs +107 -13
- crates/client/src/gui/share_view.rs +20 -37
- crates/client/src/gui/sidebar.rs +73 -42
crates/client/src/gui/camera_view.rsmodified+3 -37
| @@ -11,7 +11,7 @@ use gpui_kit::{ | ||
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | 13 | use super::{ |
| 14 | - Palette, Tooltip as _, Yumush, avatar, clickable, entity_action, | |
| 14 | + Palette, Tooltip as _, Yumush, avatar, clickable, | |
| 15 | 15 | media_view::to_render_image, |
| 16 | 16 | notify_error, |
| 17 | 17 | share_view::{self, FRAME_TICK}, |
| @@ -211,16 +211,7 @@ impl Yumush { | ||
| 211 | 211 | .overflow_x_scroll() |
| 212 | 212 | .border_b_1() |
| 213 | 213 | .border_color(palette.border) |
| 214 | - .children(tiles) | |
| 215 | - .child(icon_button( | |
| 216 | - "stage_grid", | |
| 217 | - palette, | |
| 218 | - IconName::LayoutDashboard, | |
| 219 | - "Grid", | |
| 220 | - entity_action(entity, |yumush, _, cx| { | |
| 221 | - yumush.set_stage(Stage::Grid, cx) | |
| 222 | - }), | |
| 223 | - )), | |
| 214 | + .children(tiles), | |
| 224 | 215 | ) |
| 225 | 216 | } |
| 226 | 217 | |
| @@ -280,23 +271,7 @@ impl Yumush { | ||
| 280 | 271 | .next() |
| 281 | 272 | .unwrap_or_else(|| div().flex_1().into_any_element()) |
| 282 | 273 | })) |
| 283 | - })) | |
| 284 | - .child( | |
| 285 | - icon_button( | |
| 286 | - "stage_minimize", | |
| 287 | - palette, | |
| 288 | - IconName::Minimize, | |
| 289 | - "Strip", | |
| 290 | - entity_action(entity, |yumush, _, cx| { | |
| 291 | - yumush.set_stage(Stage::Strip, cx) | |
| 292 | - }), | |
| 293 | - ) | |
| 294 | - .absolute() | |
| 295 | - .top(px(12.)) | |
| 296 | - .right(px(12.)) | |
| 297 | - .bg(palette.panel) | |
| 298 | - .occlude(), | |
| 299 | - ), | |
| 274 | + })), | |
| 300 | 275 | ) |
| 301 | 276 | } |
| 302 | 277 | } |
| @@ -514,12 +489,3 @@ fn grid_cell( | ||
| 514 | 489 | cell.into_any_element() |
| 515 | 490 | } |
| 516 | 491 | } |
| 517 | - | |
| 518 | -pub(super) fn stage_toggle(yumush: &mut Yumush, cx: &mut Context<Yumush>) { | |
| 519 | - let next = if yumush.chat.stage == Stage::Hidden { | |
| 520 | - Stage::Strip | |
| 521 | - } else { | |
| 522 | - Stage::Hidden | |
| 523 | - }; | |
| 524 | - yumush.set_stage(next, cx); | |
| 525 | -} |
crates/client/src/gui/chat.rsmodified+58 -25
| @@ -6,7 +6,7 @@ use std::{ | ||
| 6 | 6 | time::{Duration, Instant}, |
| 7 | 7 | }; |
| 8 | 8 | |
| 9 | -use crate::gui::camera_view::{self, Stage, Tile}; | |
| 9 | +use crate::gui::camera_view::{Stage, Tile}; | |
| 10 | 10 | use crate::gui::social::InviteLookup; |
| 11 | 11 | use crate::gui::voice_stats::{SAMPLE_HISTORY, StatsTab}; |
| 12 | 12 | use crate::gui::wave::Waves; |
| @@ -917,9 +917,15 @@ impl Chat { | ||
| 917 | 917 | } else { |
| 918 | 918 | self.messages |
| 919 | 919 | .iter() |
| 920 | + .chain(&self.pins) | |
| 920 | 921 | .flat_map(|message| { |
| 921 | 922 | std::iter::once(message.user_id) |
| 922 | 923 | .chain(message.reply.as_ref().map(|quote| quote.user_id)) |
| 924 | + .chain(message.poll.iter().flat_map(|poll| { | |
| 925 | + poll.options | |
| 926 | + .iter() | |
| 927 | + .flat_map(|option| option.voter_ids.iter().copied()) | |
| 928 | + })) | |
| 923 | 929 | }) |
| 924 | 930 | .collect() |
| 925 | 931 | }; |
| @@ -2460,8 +2466,7 @@ impl Yumush { | ||
| 2460 | 2466 | if users.is_empty() { |
| 2461 | 2467 | return None; |
| 2462 | 2468 | } |
| 2463 | - let stage = self.stage_sources().len(); | |
| 2464 | - let hidden = self.chat.stage == Stage::Hidden; | |
| 2469 | + let current = self.chat.stage; | |
| 2465 | 2470 | |
| 2466 | 2471 | Some( |
| 2467 | 2472 | div() |
| @@ -2488,32 +2493,33 @@ impl Yumush { | ||
| 2488 | 2493 | ) |
| 2489 | 2494 | })) |
| 2490 | 2495 | .children( |
| 2491 | - self.in_stage_chat() | |
| 2492 | - .then(|| { | |
| 2493 | - clickable( | |
| 2494 | - if hidden { | |
| 2495 | - "stage_toggle_hidden" | |
| 2496 | - } else { | |
| 2497 | - "stage_toggle_shown" | |
| 2498 | - }, | |
| 2499 | - palette, | |
| 2500 | - entity_action(entity, |yumush: &mut Yumush, _, cx| { | |
| 2501 | - camera_view::stage_toggle(yumush, cx) | |
| 2502 | - }), | |
| 2503 | - ) | |
| 2504 | - .tip(if hidden { "Show stage" } else { "Hide stage" }) | |
| 2496 | + self.in_stage_chat().then(|| { | |
| 2497 | + div() | |
| 2505 | 2498 | .ml(px(8.)) |
| 2506 | - .h(px(22.)) | |
| 2507 | - .px(px(6.)) | |
| 2508 | 2499 | .flex() |
| 2509 | 2500 | .items_center() |
| 2510 | - .gap(px(4.)) | |
| 2501 | + .p(px(2.)) | |
| 2502 | + .gap(px(2.)) | |
| 2511 | 2503 | .rounded(px(6.)) |
| 2512 | - .text_size(text(11.)) | |
| 2513 | - .text_color(if hidden { palette.muted } else { palette.accent }) | |
| 2514 | - .child(Icon::new(IconName::LayoutDashboard).w(px(14.)).h(px(14.))) | |
| 2515 | - .child(stage.to_string()) | |
| 2516 | - }), | |
| 2504 | + .border_1() | |
| 2505 | + .border_color(palette.border) | |
| 2506 | + .child(stage_button( | |
| 2507 | + entity, | |
| 2508 | + palette, | |
| 2509 | + Stage::Strip, | |
| 2510 | + current == Stage::Strip, | |
| 2511 | + IconName::GalleryHorizontal, | |
| 2512 | + "Strip", | |
| 2513 | + )) | |
| 2514 | + .child(stage_button( | |
| 2515 | + entity, | |
| 2516 | + palette, | |
| 2517 | + Stage::Grid, | |
| 2518 | + current == Stage::Grid, | |
| 2519 | + IconName::LayoutGrid, | |
| 2520 | + "Grid", | |
| 2521 | + )) | |
| 2522 | + }), | |
| 2517 | 2523 | ), |
| 2518 | 2524 | ) |
| 2519 | 2525 | } |
| @@ -3042,3 +3048,30 @@ fn hard_breaks(body: &str) -> String { | ||
| 3042 | 3048 | .collect(); |
| 3043 | 3049 | lines.join("\n") |
| 3044 | 3050 | } |
| 3051 | + | |
| 3052 | +fn stage_button( | |
| 3053 | + entity: &Entity<Yumush>, | |
| 3054 | + palette: Palette, | |
| 3055 | + layout: Stage, | |
| 3056 | + active: bool, | |
| 3057 | + icon: IconName, | |
| 3058 | + name: &'static str, | |
| 3059 | +) -> impl IntoElement { | |
| 3060 | + clickable( | |
| 3061 | + format!("stage_{name}_{active}"), | |
| 3062 | + palette, | |
| 3063 | + entity_action(entity, move |yumush: &mut Yumush, _, cx| { | |
| 3064 | + let next = if active { Stage::Hidden } else { layout }; | |
| 3065 | + yumush.set_stage(next, cx) | |
| 3066 | + }), | |
| 3067 | + ) | |
| 3068 | + .tip(if active { "Hide" } else { name }) | |
| 3069 | + .size(px(22.)) | |
| 3070 | + .flex() | |
| 3071 | + .items_center() | |
| 3072 | + .justify_center() | |
| 3073 | + .rounded(px(4.)) | |
| 3074 | + .when(active, |this| this.bg(palette.hover)) | |
| 3075 | + .text_color(if active { palette.accent } else { palette.muted }) | |
| 3076 | + .child(Icon::new(icon).w(px(14.)).h(px(14.))) | |
| 3077 | +} |
crates/client/src/gui/poll.rsmodified+107 -13
| @@ -2,15 +2,16 @@ use common::model::Id; | ||
| 2 | 2 | use common::call::{ClosePoll, MyVotes, Vote}; |
| 3 | 3 | use common::model::{Message, Poll, Rank, User}; |
| 4 | 4 | use gpui_kit::{ |
| 5 | - Context, Div, Entity, FontWeight, InteractiveElement, IntoElement, ParentElement, Styled, | |
| 6 | - Window, assets::IconName, component::Icon, div, prelude::FluentBuilder as _, px, relative, | |
| 5 | + Anchor, AnyElement, Context, Div, Entity, FontWeight, InteractiveElement, IntoElement, | |
| 6 | + ParentElement, StatefulInteractiveElement, Styled, Window, assets::IconName, component::Icon, component::popover::Popover, | |
| 7 | + div, prelude::FluentBuilder as _, px, relative, | |
| 7 | 8 | }; |
| 8 | 9 | |
| 9 | 10 | use super::{ |
| 10 | - Palette, Tooltip as _, Yumush, avatar, | |
| 11 | + Palette, Trigger, Tooltip as _, Yumush, avatar, | |
| 11 | 12 | chat::Chat, |
| 12 | - clickable, text, | |
| 13 | - widget::{icon_button, spawn_done}, | |
| 13 | + clickable, hoverable, pop_in, text, | |
| 14 | + widget::{icon_button, panel, spawn_done}, | |
| 14 | 15 | }; |
| 15 | 16 | |
| 16 | 17 | pub fn voter_count(poll: &Poll) -> usize { |
| @@ -57,6 +58,100 @@ fn status_icon(id: String, icon: IconName, tip: &'static str, palette: Palette) | ||
| 57 | 58 | .child(Icon::new(icon).w(px(12.)).h(px(12.))) |
| 58 | 59 | } |
| 59 | 60 | |
| 61 | +fn voters_label(voters: usize) -> Div { | |
| 62 | + div() | |
| 63 | + .flex() | |
| 64 | + .items_center() | |
| 65 | + .gap(px(4.)) | |
| 66 | + .child(Icon::new(IconName::Users).w(px(12.)).h(px(12.))) | |
| 67 | + .child(format!("{voters}")) | |
| 68 | +} | |
| 69 | + | |
| 70 | +fn voters_popover(key: &str, poll: &Poll, entity: &Entity<Yumush>, palette: Palette) -> AnyElement { | |
| 71 | + let options = poll.options.clone(); | |
| 72 | + let list = format!("poll_voters_list_{key}"); | |
| 73 | + let open = entity.clone(); | |
| 74 | + Popover::new(format!("poll_voters_{key}")) | |
| 75 | + .anchor(Anchor::BottomLeft) | |
| 76 | + .appearance(false) | |
| 77 | + .trigger(Trigger::new(hoverable( | |
| 78 | + format!("poll_voters_trigger_{key}"), | |
| 79 | + voters_label(voter_count(poll)), | |
| 80 | + palette, | |
| 81 | + ))) | |
| 82 | + .content(move |_, _, cx| { | |
| 83 | + let yumush = open.read(cx); | |
| 84 | + let chat = &yumush.chat; | |
| 85 | + let rows = options | |
| 86 | + .iter() | |
| 87 | + .filter(|option| !option.voter_ids.is_empty()) | |
| 88 | + .map(|option| { | |
| 89 | + div() | |
| 90 | + .flex() | |
| 91 | + .flex_col() | |
| 92 | + .child( | |
| 93 | + div() | |
| 94 | + .h(px(26.)) | |
| 95 | + .flex() | |
| 96 | + .items_center() | |
| 97 | + .gap(px(8.)) | |
| 98 | + .text_size(text(11.)) | |
| 99 | + .text_color(palette.muted) | |
| 100 | + .child( | |
| 101 | + div() | |
| 102 | + .flex_1() | |
| 103 | + .min_w_0() | |
| 104 | + .truncate() | |
| 105 | + .child(option.text.clone()), | |
| 106 | + ) | |
| 107 | + .child( | |
| 108 | + div() | |
| 109 | + .flex_shrink_0() | |
| 110 | + .child(format!("{}", option.voter_ids.len())), | |
| 111 | + ), | |
| 112 | + ) | |
| 113 | + .children(option.voter_ids.iter().filter_map(|id| { | |
| 114 | + chat.author(*id).map(|user| { | |
| 115 | + div() | |
| 116 | + .h(px(26.)) | |
| 117 | + .flex() | |
| 118 | + .items_center() | |
| 119 | + .gap(px(8.)) | |
| 120 | + .text_size(text(12.)) | |
| 121 | + .child(avatar( | |
| 122 | + palette, | |
| 123 | + user, | |
| 124 | + px(18.), | |
| 125 | + text(8.), | |
| 126 | + &chat.avatars, | |
| 127 | + )) | |
| 128 | + .child( | |
| 129 | + div() | |
| 130 | + .flex_1() | |
| 131 | + .min_w_0() | |
| 132 | + .truncate() | |
| 133 | + .child(user.username.clone()), | |
| 134 | + ) | |
| 135 | + }) | |
| 136 | + })) | |
| 137 | + }); | |
| 138 | + pop_in( | |
| 139 | + list.clone(), | |
| 140 | + panel(palette) | |
| 141 | + .w(px(260.)) | |
| 142 | + .id(list.clone()) | |
| 143 | + .max_h(px(320.)) | |
| 144 | + .overflow_y_scroll() | |
| 145 | + .p(px(6.)) | |
| 146 | + .flex() | |
| 147 | + .flex_col() | |
| 148 | + .children(rows), | |
| 149 | + Anchor::BottomLeft, | |
| 150 | + ) | |
| 151 | + }) | |
| 152 | + .into_any_element() | |
| 153 | +} | |
| 154 | + | |
| 60 | 155 | pub fn poll_card( |
| 61 | 156 | poll: &Poll, |
| 62 | 157 | mode: PollMode, |
| @@ -194,20 +289,19 @@ pub fn poll_card( | ||
| 194 | 289 | ) |
| 195 | 290 | }); |
| 196 | 291 | |
| 292 | + let voters_view = if poll.public { | |
| 293 | + voters_popover(&key, poll, entity, palette) | |
| 294 | + } else { | |
| 295 | + voters_label(voters).into_any_element() | |
| 296 | + }; | |
| 297 | + | |
| 197 | 298 | let footer = div() |
| 198 | 299 | .flex() |
| 199 | 300 | .items_center() |
| 200 | 301 | .justify_between() |
| 201 | 302 | .text_size(text(12.)) |
| 202 | 303 | .text_color(palette.muted) |
| 203 | - .child( | |
| 204 | - div() | |
| 205 | - .flex() | |
| 206 | - .items_center() | |
| 207 | - .gap(px(4.)) | |
| 208 | - .child(Icon::new(IconName::Users).w(px(12.)).h(px(12.))) | |
| 209 | - .child(format!("{voters}")), | |
| 210 | - ) | |
| 304 | + .child(voters_view) | |
| 211 | 305 | .children(close_id.map(|close_id| { |
| 212 | 306 | let close_entity = entity.clone(); |
| 213 | 307 | icon_button( |
crates/client/src/gui/share_view.rsmodified+20 -37
| @@ -24,7 +24,6 @@ use super::{ | ||
| 24 | 24 | notify_error, pop_in, |
| 25 | 25 | settings_page::segmented, |
| 26 | 26 | text, |
| 27 | - wave::wave_slot, | |
| 28 | 27 | widget::{icon_button, spawn_warn}, |
| 29 | 28 | }; |
| 30 | 29 | use crate::{ |
| @@ -452,6 +451,7 @@ impl Yumush { | ||
| 452 | 451 | .relative() |
| 453 | 452 | .occlude() |
| 454 | 453 | .bg(gpui_kit::black()) |
| 454 | + .group("viewer") | |
| 455 | 455 | .children( |
| 456 | 456 | viewer |
| 457 | 457 | .frame |
| @@ -461,53 +461,36 @@ impl Yumush { | ||
| 461 | 461 | .child( |
| 462 | 462 | div() |
| 463 | 463 | .absolute() |
| 464 | - .left(px(10.)) | |
| 465 | - .top(px(10.)) | |
| 466 | - .px(px(8.)) | |
| 467 | - .py(px(4.)) | |
| 468 | - .flex() | |
| 469 | - .items_center() | |
| 470 | - .gap(px(6.)) | |
| 471 | - .rounded(px(6.)) | |
| 472 | - .border_1() | |
| 473 | - .border_color(palette.border) | |
| 474 | - .bg(palette.panel) | |
| 475 | - .occlude() | |
| 476 | - .text_size(text(12.)) | |
| 477 | - .child(Icon::new(kind_icon(viewer.kind)).w(px(14.)).h(px(14.))) | |
| 478 | - .child(name.to_string()), | |
| 479 | - ) | |
| 480 | - .child( | |
| 481 | - div() | |
| 482 | - .absolute() | |
| 483 | - .right(px(10.)) | |
| 484 | - .bottom(px(10.)) | |
| 485 | - .p(px(6.)) | |
| 464 | + .left_0() | |
| 465 | + .right_0() | |
| 466 | + .bottom_0() | |
| 467 | + .h(px(44.)) | |
| 468 | + .px(px(12.)) | |
| 486 | 469 | .flex() |
| 487 | 470 | .items_center() |
| 488 | 471 | .gap(px(8.)) |
| 489 | - .rounded(px(8.)) | |
| 490 | - .border_1() | |
| 491 | - .border_color(palette.border) | |
| 492 | - .bg(palette.panel) | |
| 472 | + .bg(gpui_kit::black().opacity(0.55)) | |
| 493 | 473 | .occlude() |
| 474 | + .opacity(0.) | |
| 475 | + .group_hover("viewer", |style| style.opacity(1.)) | |
| 494 | 476 | .text_size(text(12.)) |
| 495 | - .children(audio.then(|| { | |
| 496 | - wave_slot(self.chat.waves.share(viewer.user_id), 14., palette.alert) | |
| 497 | - })) | |
| 477 | + .text_color(palette.text) | |
| 478 | + .child(Icon::new(kind_icon(viewer.kind)).w(px(14.)).h(px(14.))) | |
| 479 | + .child(name.to_string()) | |
| 480 | + .child(div().flex_1()) | |
| 498 | 481 | .children(audio.then(|| { |
| 499 | 482 | Icon::new(IconName::Volume2) |
| 500 | 483 | .w(px(14.)) |
| 501 | 484 | .h(px(14.)) |
| 502 | 485 | .text_color(palette.muted) |
| 503 | 486 | })) |
| 504 | - .children( | |
| 505 | - audio.then(|| { | |
| 506 | - div() | |
| 507 | - .w(px(100.)) | |
| 508 | - .child(Slider::new(&viewer.volume).bg(palette.muted)) | |
| 509 | - }), | |
| 510 | - ) | |
| 487 | + .children(audio.then(|| { | |
| 488 | + div().w(px(80.)).child( | |
| 489 | + Slider::new(&viewer.volume) | |
| 490 | + .bg(palette.accent) | |
| 491 | + .text_color(palette.text), | |
| 492 | + ) | |
| 493 | + })) | |
| 511 | 494 | .child(icon_button( |
| 512 | 495 | format!("share_fullscreen_{}", viewer.fullscreen), |
| 513 | 496 | palette, |
crates/client/src/gui/sidebar.rsmodified+73 -42
| @@ -240,8 +240,13 @@ impl Yumush { | ||
| 240 | 240 | let screen = self.chat.share_of(community_id, user.id, Kind::Screen).is_some(); |
| 241 | 241 | let camera = self.chat.share_of(community_id, user.id, Kind::Camera).is_some(); |
| 242 | 242 | |
| 243 | + let user_id = user.id; | |
| 244 | + let watch_screen = entity.clone(); | |
| 245 | + let watch_camera = entity.clone(); | |
| 246 | + let sharing = self.chat.waves.share(user_id).is_some(); | |
| 247 | + | |
| 243 | 248 | let member = profile_popover( |
| 244 | - format!("voice_member_{}", user.id), | |
| 249 | + format!("voice_member_{user_id}"), | |
| 245 | 250 | Anchor::BottomLeft, |
| 246 | 251 | user, |
| 247 | 252 | entity, |
| @@ -249,11 +254,9 @@ impl Yumush { | ||
| 249 | 254 | .flex() |
| 250 | 255 | .items_center() |
| 251 | 256 | .gap(px(6.)) |
| 252 | - .px(px(4.)) | |
| 253 | - .py(px(2.)) | |
| 254 | - .rounded(px(6.)) | |
| 257 | + .flex_1() | |
| 258 | + .min_w_0() | |
| 255 | 259 | .cursor_pointer() |
| 256 | - .hover(move |style| style.bg(palette.hover)) | |
| 257 | 260 | .child( |
| 258 | 261 | avatar(palette, user, px(18.), text(9.), &self.chat.avatars) |
| 259 | 262 | .border_2() |
| @@ -271,45 +274,73 @@ impl Yumush { | ||
| 271 | 274 | .text_size(text(12.)) |
| 272 | 275 | .text_color(palette.text) |
| 273 | 276 | .child(user.username.clone()), |
| 274 | - ) | |
| 275 | - .when(camera, |row| { | |
| 276 | - row.child( | |
| 277 | - Icon::new(IconName::Video) | |
| 278 | - .w(px(12.)) | |
| 279 | - .h(px(12.)) | |
| 280 | - .text_color(palette.alert), | |
| 281 | - ) | |
| 282 | - }) | |
| 283 | - .child(wave_slot(self.chat.waves.voice(user.id), 12., palette.ok)), | |
| 277 | + ), | |
| 284 | 278 | ); |
| 285 | - let user_id = user.id; | |
| 286 | - let watch = entity.clone(); | |
| 287 | - | |
| 288 | - div().flex().flex_col().child(member).when(screen, |column| { | |
| 289 | - column.child( | |
| 290 | - clickable(format!("voice_screen_{user_id}"), palette, move |window, cx| { | |
| 291 | - watch.update(cx, |yumush, cx| { | |
| 292 | - yumush.toggle_viewer(user_id, Kind::Screen, window, cx) | |
| 293 | - }); | |
| 294 | - }) | |
| 295 | - .tip("Watch") | |
| 296 | - .ml(px(28.)) | |
| 297 | - .px(px(4.)) | |
| 298 | - .py(px(2.)) | |
| 299 | - .flex() | |
| 300 | - .items_center() | |
| 301 | - .gap(px(6.)) | |
| 302 | - .rounded(px(6.)) | |
| 303 | - .child( | |
| 304 | - Icon::new(IconName::ScreenShare) | |
| 305 | - .w(px(12.)) | |
| 306 | - .h(px(12.)) | |
| 307 | - .text_color(palette.alert), | |
| 308 | - ) | |
| 309 | - .child(div().flex_1()) | |
| 310 | - .child(wave_slot(self.chat.waves.share(user_id), 12., palette.alert)), | |
| 279 | + | |
| 280 | + div() | |
| 281 | + .flex() | |
| 282 | + .items_center() | |
| 283 | + .gap(px(4.)) | |
| 284 | + .px(px(4.)) | |
| 285 | + .py(px(2.)) | |
| 286 | + .rounded(px(6.)) | |
| 287 | + .hover(move |style| style.bg(palette.hover)) | |
| 288 | + .child(div().flex_1().min_w_0().child(member)) | |
| 289 | + .child( | |
| 290 | + div() | |
| 291 | + .w(px(20.)) | |
| 292 | + .h(px(20.)) | |
| 293 | + .flex_shrink_0() | |
| 294 | + .when(screen, |slot| { | |
| 295 | + slot.child( | |
| 296 | + clickable(format!("voice_screen_{user_id}"), palette, move |window, cx| { | |
| 297 | + watch_screen.update(cx, |yumush, cx| { | |
| 298 | + yumush.toggle_viewer(user_id, Kind::Screen, window, cx) | |
| 299 | + }); | |
| 300 | + }) | |
| 301 | + .tip("Watch") | |
| 302 | + .size_full() | |
| 303 | + .flex() | |
| 304 | + .items_center() | |
| 305 | + .justify_center() | |
| 306 | + .rounded(px(4.)) | |
| 307 | + .child( | |
| 308 | + Icon::new(IconName::ScreenShare) | |
| 309 | + .w(px(12.)) | |
| 310 | + .h(px(12.)) | |
| 311 | + .text_color(if sharing { palette.ok } else { palette.alert }), | |
| 312 | + ), | |
| 313 | + ) | |
| 314 | + }), | |
| 311 | 315 | ) |
| 312 | - }) | |
| 316 | + .child( | |
| 317 | + div() | |
| 318 | + .w(px(20.)) | |
| 319 | + .h(px(20.)) | |
| 320 | + .flex_shrink_0() | |
| 321 | + .when(camera, |slot| { | |
| 322 | + slot.child( | |
| 323 | + clickable(format!("voice_camera_{user_id}"), palette, move |window, cx| { | |
| 324 | + watch_camera.update(cx, |yumush, cx| { | |
| 325 | + yumush.toggle_viewer(user_id, Kind::Camera, window, cx) | |
| 326 | + }); | |
| 327 | + }) | |
| 328 | + .tip("Watch") | |
| 329 | + .size_full() | |
| 330 | + .flex() | |
| 331 | + .items_center() | |
| 332 | + .justify_center() | |
| 333 | + .rounded(px(4.)) | |
| 334 | + .child( | |
| 335 | + Icon::new(IconName::Video) | |
| 336 | + .w(px(12.)) | |
| 337 | + .h(px(12.)) | |
| 338 | + .text_color(palette.alert), | |
| 339 | + ), | |
| 340 | + ) | |
| 341 | + }), | |
| 342 | + ) | |
| 343 | + .child(wave_slot(self.chat.waves.voice(user_id), 12., palette.ok)) | |
| 313 | 344 | } |
| 314 | 345 | |
| 315 | 346 | fn voice_dot(&self, entity: &Entity<Self>, palette: Palette) -> Option<impl IntoElement> { |