From 9e0576caca8d5f11fb9edd3edfbb27a4338b63c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 26 Nov 2026 02:33:26 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20voice=20and=20share=20wav?= =?UTF-8?q?es=20keep=20a=20fixed=20slot=20so=20rows=20don't=20shift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/share_view.rs | 15 ++++----------- crates/client/src/gui/sidebar.rs | 9 ++------- crates/client/src/gui/wave.rs | 9 ++++++++- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/crates/client/src/gui/share_view.rs b/crates/client/src/gui/share_view.rs index 35f0a0e..5590829 100644 --- a/crates/client/src/gui/share_view.rs +++ b/crates/client/src/gui/share_view.rs @@ -24,7 +24,7 @@ use super::{ notify_error, pop_in, settings_page::segmented, text, - wave::wave, + wave::wave_slot, widget::{icon_button, spawn_warn}, }; use crate::{ @@ -485,16 +485,9 @@ impl Yumush { .bg(palette.panel) .occlude() .text_size(text(12.)) - .children( - audio - .then(|| { - self.chat - .waves - .share(viewer.user_id) - .map(|history| wave(history, 14., palette.alert)) - }) - .flatten(), - ) + .children(audio.then(|| { + wave_slot(self.chat.waves.share(viewer.user_id), 14., palette.alert) + })) .children(audio.then(|| { Icon::new(IconName::Volume2) .w(px(14.)) diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index 77facf5..b712e3b 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -30,7 +30,7 @@ use super::{ settings_page::{segment, segment_track}, social::Relation, voice_stats, - wave::wave, + wave::wave_slot, widget::{bare_input, compact_frame, icon_button}, }; @@ -288,12 +288,7 @@ impl Yumush { .text_color(palette.alert), ) }) - .children( - self.chat - .waves - .voice(user.id) - .map(|history| wave(history, 12., palette.ok)), - ), + .child(wave_slot(self.chat.waves.voice(user.id), 12., palette.ok)), ) } diff --git a/crates/client/src/gui/wave.rs b/crates/client/src/gui/wave.rs index c6ec039..9a1d383 100644 --- a/crates/client/src/gui/wave.rs +++ b/crates/client/src/gui/wave.rs @@ -89,7 +89,14 @@ impl Waves { } } -pub fn wave(history: &VecDeque, size: f32, color: Hsla) -> Div { +pub fn wave_slot(history: Option<&VecDeque>, size: f32, color: Hsla) -> Div { + div() + .flex_shrink_0() + .w(px(spectrum::BANDS as f32 * (BAR_WIDTH + 1.))) + .children(history.map(|history| wave(history, size, color))) +} + +fn wave(history: &VecDeque, size: f32, color: Hsla) -> Div { div() .flex() .items_center()