From bcb6bbd304325a70388e9353046c5253e5c2367b 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:07:52 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20stream=20audio=20meter=20(s?= =?UTF-8?q?harer:=20beside=20your=20voice=20line;=20viewers:=20on=20the=20?= =?UTF-8?q?stream's=20label)=20in=20the=20sharer's=20hue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/call_bar.rs | 20 ++++++++++++++++++++ crates/client/src/gui/camera_view.rs | 9 ++++++++- crates/client/src/gui/dock.rs | 5 +++++ crates/client/src/gui/gallery.rs | 1 + crates/client/src/gui/wave.rs | 4 ++++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/crates/client/src/gui/call_bar.rs b/crates/client/src/gui/call_bar.rs index 6eb3ed9..473277f 100644 --- a/crates/client/src/gui/call_bar.rs +++ b/crates/client/src/gui/call_bar.rs @@ -23,6 +23,7 @@ pub struct CallBar { pub deafened: bool, pub camera: bool, pub screen: bool, + pub share: Option<(Option>, gpui_kit::Hsla)>, pub stats: bool, } @@ -132,6 +133,10 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { .h(px(size::ICON)) .child(voice_line(bar.bands.as_ref(), bar.voice, t)), ) + .children( + bar.share + .map(|(bands, color)| share_meter(bands.as_ref(), color, t)), + ) .child( div() .id("bar_ping") @@ -148,3 +153,18 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { .child(controls), ) } + +pub fn share_meter(bands: Option<&VecDeque>, color: gpui_kit::Hsla, t: Tokens) -> Div { + band(space::XS) + .flex_none() + .child( + gpui_kit::component::Icon::new(IconName::ScreenShare) + .size(px(size::ICON_SM)) + .text_color(t.faint()), + ) + .child(div().w(px(size::THUMB)).h(px(size::ICON)).child(voice_line( + bands, + Voice::Live(color), + t, + ))) +} diff --git a/crates/client/src/gui/camera_view.rs b/crates/client/src/gui/camera_view.rs index cf957d7..cf47058 100644 --- a/crates/client/src/gui/camera_view.rs +++ b/crates/client/src/gui/camera_view.rs @@ -584,7 +584,7 @@ fn grid_cell( .into_any_element() } -pub(super) fn tile_label(yumush: &Yumush, palette: Palette, (user_id, _): (Id, Kind)) -> Div { +pub(super) fn tile_label(yumush: &Yumush, palette: Palette, (user_id, kind): (Id, Kind)) -> Div { let t = palette.tokens; let name = yumush .chat @@ -605,6 +605,13 @@ pub(super) fn tile_label(yumush: &Yumush, palette: Palette, (user_id, _): (Id, K .size(px(size::ICON_SM)) .text_color(t.bad()) })) + .children((kind == Kind::Screen).then(|| { + super::call_bar::share_meter( + yumush.chat.waves.share_line(user_id), + t.person(user_id), + t, + ) + })) } fn tile_name(name: impl Into, ink: Ink, t: super::style::Tokens) -> Div { diff --git a/crates/client/src/gui/dock.rs b/crates/client/src/gui/dock.rs index 5d78647..5ce4d83 100644 --- a/crates/client/src/gui/dock.rs +++ b/crates/client/src/gui/dock.rs @@ -45,6 +45,11 @@ impl Yumush { deafened, camera: self.network.share_source(Kind::Camera).is_some(), screen: self.network.share_source(Kind::Screen).is_some(), + share: self + .network + .share_source(Kind::Screen) + .is_some() + .then(|| (self.chat.waves.share_line(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/gallery.rs b/crates/client/src/gui/gallery.rs index 8edc099..e09048a 100644 --- a/crates/client/src/gui/gallery.rs +++ b/crates/client/src/gui/gallery.rs @@ -335,6 +335,7 @@ fn call_page(state: State, t: Tokens) -> impl IntoElement { deafened: false, camera: state == State::Many, screen: state == State::Many, + share: (state == State::Many).then(|| (Some(bands(2.)), t.hue(Hue::Amber))), stats: false, }; let none = || -> call_bar::Action { Rc::new(|_, _| {}) }; diff --git a/crates/client/src/gui/wave.rs b/crates/client/src/gui/wave.rs index cc31282..c017986 100644 --- a/crates/client/src/gui/wave.rs +++ b/crates/client/src/gui/wave.rs @@ -128,6 +128,10 @@ 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)