From ae3224490455295822159aed0ab7b4baabb77fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 27 Nov 2026 23:35:37 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20sidebar=20watch=20icons?= =?UTF-8?q?=20brighten=20only=20while=20you=20watch=20(the=20screen=20one?= =?UTF-8?q?=20lit=20up=20whenever=20its=20stream=20had=20sound,=20looking?= =?UTF-8?q?=20toggled)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/camera_view.rs | 2 +- crates/client/src/gui/dock.rs | 2 +- crates/client/src/gui/sidebar.rs | 8 +------- crates/client/src/gui/wave.rs | 10 +--------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/crates/client/src/gui/camera_view.rs b/crates/client/src/gui/camera_view.rs index 291ba8c..01ef619 100644 --- a/crates/client/src/gui/camera_view.rs +++ b/crates/client/src/gui/camera_view.rs @@ -304,7 +304,7 @@ impl Yumush { .h(px(size::CONTROL_SM)) .children(screen.then(|| { super::call_bar::share_meter( - self.chat.waves.share_line(user.id), + self.chat.waves.share(user.id), t.person(user.id), t, ) diff --git a/crates/client/src/gui/dock.rs b/crates/client/src/gui/dock.rs index 3dd68b9..9d3ddfa 100644 --- a/crates/client/src/gui/dock.rs +++ b/crates/client/src/gui/dock.rs @@ -49,7 +49,7 @@ impl Yumush { share: self .network .share_source(Kind::Screen) - .map(|_| (self.chat.waves.share_line(me).cloned(), t.person(me))), + .map(|_| (self.chat.waves.share(me).cloned(), t.person(me))), stats: self.chat.stats_at == Some(super::chat::StatsAt::Dock), }; let go_id = community.id; diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index 74a29ce..9996858 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -1,5 +1,3 @@ -use std::collections::VecDeque; - use super::text; use common::model::Id; use common::{ @@ -303,7 +301,6 @@ impl Yumush { user_id, Kind::Camera, self.is_watching(user_id, Kind::Camera), - None, palette, ) })) @@ -313,7 +310,6 @@ impl Yumush { user_id, Kind::Screen, self.is_watching(user_id, Kind::Screen), - self.chat.waves.share(user_id), palette, ) })) @@ -1038,14 +1034,12 @@ fn watch_pill( user_id: Id, kind: Kind, watching: bool, - wave: Option<&VecDeque>, palette: Palette, ) -> impl IntoElement { let icon = match kind { Kind::Camera => IconName::Video, Kind::Screen => IconName::ScreenShare, }; - let sounding = wave.is_some(); let tip = match (watching, kind) { (true, _) => "Stop watching", (false, Kind::Camera) => "Watch camera", @@ -1068,7 +1062,7 @@ fn watch_pill( .child( Icon::new(icon) .size(px(size::ICON_SM)) - .text_color(if watching || sounding { + .text_color(if watching { palette.text } else { palette.muted diff --git a/crates/client/src/gui/wave.rs b/crates/client/src/gui/wave.rs index c017986..8c12116 100644 --- a/crates/client/src/gui/wave.rs +++ b/crates/client/src/gui/wave.rs @@ -11,7 +11,6 @@ const ATTACK: f32 = 0.6; const GRAVITY: f32 = 0.012; const HOLD_TICKS: u8 = 3; const GONE: f32 = 0.02; -const AUDIBLE: f32 = 0.1; pub struct Wave { bars: VecDeque, @@ -128,15 +127,8 @@ impl Waves { self.voice.get(&id).map(|wave| &wave.bars) } - pub fn share_line(&self, id: Id) -> Option<&VecDeque> { - self.share.get(&id).map(|wave| &wave.bars) - } - pub fn share(&self, id: Id) -> Option<&VecDeque> { - self.share - .get(&id) - .filter(|wave| wave.bars.iter().any(|bar| *bar >= AUDIBLE)) - .map(|wave| &wave.bars) + self.share.get(&id).map(|wave| &wave.bars) } }