Sidebar watch icons brighten only while you watch (the screen one lit up whenever its stream had sound, looking toggled)
Browse files at this commitae3224490455295822159aed0ab7b4baabb77fbcParent: 3f11b85- fix
- sidebar watch icons brighten only while you watch (the screen one lit up whenever its stream had sound, looking toggled)
4 changed files +4 -18
- crates/client/src/gui/camera_view.rs +1 -1
- crates/client/src/gui/dock.rs +1 -1
- crates/client/src/gui/sidebar.rs +1 -7
- crates/client/src/gui/wave.rs +1 -9
crates/client/src/gui/camera_view.rsmodified+1 -1
| @@ -304,7 +304,7 @@ impl Yumush { | |||
| 304 | .h(px(size::CONTROL_SM)) | 304 | .h(px(size::CONTROL_SM)) |
| 305 | .children(screen.then(|| { | 305 | .children(screen.then(|| { |
| 306 | super::call_bar::share_meter( | 306 | super::call_bar::share_meter( |
| 307 | - self.chat.waves.share_line(user.id), | 307 | + self.chat.waves.share(user.id), |
| 308 | t.person(user.id), | 308 | t.person(user.id), |
| 309 | t, | 309 | t, |
| 310 | ) | 310 | ) |
crates/client/src/gui/dock.rsmodified+1 -1
| @@ -49,7 +49,7 @@ impl Yumush { | |||
| 49 | share: self | 49 | share: self |
| 50 | .network | 50 | .network |
| 51 | .share_source(Kind::Screen) | 51 | .share_source(Kind::Screen) |
| 52 | - .map(|_| (self.chat.waves.share_line(me).cloned(), t.person(me))), | 52 | + .map(|_| (self.chat.waves.share(me).cloned(), t.person(me))), |
| 53 | stats: self.chat.stats_at == Some(super::chat::StatsAt::Dock), | 53 | stats: self.chat.stats_at == Some(super::chat::StatsAt::Dock), |
| 54 | }; | 54 | }; |
| 55 | let go_id = community.id; | 55 | let go_id = community.id; |
crates/client/src/gui/sidebar.rsmodified+1 -7
| @@ -1,5 +1,3 @@ | |||
| 1 | -use std::collections::VecDeque; | ||
| 2 | - | ||
| 3 | use super::text; | 1 | use super::text; |
| 4 | use common::model::Id; | 2 | use common::model::Id; |
| 5 | use common::{ | 3 | use common::{ |
| @@ -303,7 +301,6 @@ impl Yumush { | |||
| 303 | user_id, | 301 | user_id, |
| 304 | Kind::Camera, | 302 | Kind::Camera, |
| 305 | self.is_watching(user_id, Kind::Camera), | 303 | self.is_watching(user_id, Kind::Camera), |
| 306 | - None, | ||
| 307 | palette, | 304 | palette, |
| 308 | ) | 305 | ) |
| 309 | })) | 306 | })) |
| @@ -313,7 +310,6 @@ impl Yumush { | |||
| 313 | user_id, | 310 | user_id, |
| 314 | Kind::Screen, | 311 | Kind::Screen, |
| 315 | self.is_watching(user_id, Kind::Screen), | 312 | self.is_watching(user_id, Kind::Screen), |
| 316 | - self.chat.waves.share(user_id), | ||
| 317 | palette, | 313 | palette, |
| 318 | ) | 314 | ) |
| 319 | })) | 315 | })) |
| @@ -1038,14 +1034,12 @@ fn watch_pill( | |||
| 1038 | user_id: Id, | 1034 | user_id: Id, |
| 1039 | kind: Kind, | 1035 | kind: Kind, |
| 1040 | watching: bool, | 1036 | watching: bool, |
| 1041 | - wave: Option<&VecDeque<f32>>, | ||
| 1042 | palette: Palette, | 1037 | palette: Palette, |
| 1043 | ) -> impl IntoElement { | 1038 | ) -> impl IntoElement { |
| 1044 | let icon = match kind { | 1039 | let icon = match kind { |
| 1045 | Kind::Camera => IconName::Video, | 1040 | Kind::Camera => IconName::Video, |
| 1046 | Kind::Screen => IconName::ScreenShare, | 1041 | Kind::Screen => IconName::ScreenShare, |
| 1047 | }; | 1042 | }; |
| 1048 | - let sounding = wave.is_some(); | ||
| 1049 | let tip = match (watching, kind) { | 1043 | let tip = match (watching, kind) { |
| 1050 | (true, _) => "Stop watching", | 1044 | (true, _) => "Stop watching", |
| 1051 | (false, Kind::Camera) => "Watch camera", | 1045 | (false, Kind::Camera) => "Watch camera", |
| @@ -1068,7 +1062,7 @@ fn watch_pill( | |||
| 1068 | .child( | 1062 | .child( |
| 1069 | Icon::new(icon) | 1063 | Icon::new(icon) |
| 1070 | .size(px(size::ICON_SM)) | 1064 | .size(px(size::ICON_SM)) |
| 1071 | - .text_color(if watching || sounding { | 1065 | + .text_color(if watching { |
| 1072 | palette.text | 1066 | palette.text |
| 1073 | } else { | 1067 | } else { |
| 1074 | palette.muted | 1068 | palette.muted |
crates/client/src/gui/wave.rsmodified+1 -9
| @@ -11,7 +11,6 @@ const ATTACK: f32 = 0.6; | |||
| 11 | const GRAVITY: f32 = 0.012; | 11 | const GRAVITY: f32 = 0.012; |
| 12 | const HOLD_TICKS: u8 = 3; | 12 | const HOLD_TICKS: u8 = 3; |
| 13 | const GONE: f32 = 0.02; | 13 | const GONE: f32 = 0.02; |
| 14 | -const AUDIBLE: f32 = 0.1; | ||
| 15 | 14 | ||
| 16 | pub struct Wave { | 15 | pub struct Wave { |
| 17 | bars: VecDeque<f32>, | 16 | bars: VecDeque<f32>, |
| @@ -128,15 +127,8 @@ impl Waves { | |||
| 128 | self.voice.get(&id).map(|wave| &wave.bars) | 127 | self.voice.get(&id).map(|wave| &wave.bars) |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | - pub fn share_line(&self, id: Id) -> Option<&VecDeque<f32>> { | ||
| 132 | - self.share.get(&id).map(|wave| &wave.bars) | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | pub fn share(&self, id: Id) -> Option<&VecDeque<f32>> { | 130 | pub fn share(&self, id: Id) -> Option<&VecDeque<f32>> { |
| 136 | - self.share | 131 | + self.share.get(&id).map(|wave| &wave.bars) |
| 137 | - .get(&id) | ||
| 138 | - .filter(|wave| wave.bars.iter().any(|bar| *bar >= AUDIBLE)) | ||
| 139 | - .map(|wave| &wave.bars) | ||
| 140 | } | 132 | } |
| 141 | } | 133 | } |
| 142 | 134 | ||