diff --git a/crates/client/src/gui/call_bar.rs b/crates/client/src/gui/call_bar.rs index 49d452a..04d5e1b 100644 --- a/crates/client/src/gui/call_bar.rs +++ b/crates/client/src/gui/call_bar.rs @@ -179,40 +179,31 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { .map(|(bands, color)| share_meter(bands.as_ref(), color, t)), ) .child( - div() - .id("bar_ping_line") + band(space::SM) + .id("bar_ping") .flex_none() - .w(px(size::ROW)) - .h(px(size::ICON)) + .h(px(size::CONTROL)) + .px(px(space::MD)) + .rounded_full() + .when(bar.stats, |ping| ping.bg(t.press())) + .hover({ + let hov = t.hov(); + move |style| style.bg(hov) + }) .cursor_pointer() .tip("Connection stats") - .on_click({ - let stats = run(&actions.stats); - move |_, window, cx| stats(window, cx) - }) - .child(super::parts::spark( - pings, - super::voice_stats::SAMPLE_HISTORY, - bar.quality.map_or(t.faint(), |quality| quality.color(t)), - )), - ) - .child( - div() - .flex_none() - .w(px(size::ROW)) - .flex() - .justify_end() + .on_click(move |_, window, cx| stats(window, cx)) + .child(div().w(px(size::ROW)).h(px(size::ICON)).child( + super::parts::spark( + pings, + super::voice_stats::SAMPLE_HISTORY, + bar.quality.map_or(t.faint(), |quality| quality.color(t)), + ), + )) .child( - div() - .id("bar_ping") - .tip("Connection stats") - .cursor_pointer() - .when(bar.stats, |ping| { - ping.border_b(px(super::style::stroke::LINE)) - .border_color(t.paper()) - }) - .on_click(move |_, window, cx| stats(window, cx)) - .child(words(ping, Text::Label, ping_ink, t)), + words(ping, Text::Label, ping_ink, t) + .min_w(px(size::CHIP * 2.)) + .text_right(), ), ) .child(controls), diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index d3f3d62..71c67ca 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1460,7 +1460,10 @@ impl Yumush { .max_w(relative(0.95)) .max_h(relative(0.8)) .overflow_y_scroll() - .p(px(space::XL)) + .p(px(match at { + StatsAt::Header => space::XL, + StatsAt::Dock => space::LG, + })) .rounded(px(radius::LG)) .border_1() .border_color(palette.border) diff --git a/crates/client/src/gui/voice_stats.rs b/crates/client/src/gui/voice_stats.rs index 98a9571..f911066 100644 --- a/crates/client/src/gui/voice_stats.rs +++ b/crates/client/src/gui/voice_stats.rs @@ -21,7 +21,7 @@ use crate::voice::VoiceSample; use common::stats::Stats; pub const SAMPLE_HISTORY: usize = 60; -const LABEL_W: f32 = size::ROW * 2.; +const LABEL_W: f32 = size::ROW + space::LG; const VALUE_W: f32 = size::THUMB; const COLUMN_W: f32 = size::TALK + size::ROW * 2.; pub const PING_SCALE: f32 = 150.; @@ -94,8 +94,8 @@ pub fn stats_panel( let t = palette.tokens; let share = &stats.share; if detail == Detail::Connection { - return stack(space::XL) - .w(px(COLUMN_W)) + return stack(space::LG) + .w(px(size::POPOVER)) .when(!stats.voice.is_empty(), |column| { column.child(connection(stats, t)) })