Ping spark and ms merge into one connection-stats pill, dock stats sheet narrower (popover width, tighter padding and labels)
Browse files at this commit83ff682a7a8de488863ff0d45fb14cd2d708f4b5Parent: b4baec8- style
- ping spark and ms merge into one connection-stats pill, dock stats sheet narrower (popover width, tighter padding and labels)
3 changed files +28 -34
- crates/client/src/gui/call_bar.rs +21 -30
- crates/client/src/gui/chat.rs +4 -1
- crates/client/src/gui/voice_stats.rs +3 -3
crates/client/src/gui/call_bar.rsmodified+21 -30
| @@ -179,40 +179,31 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div { | ||
| 179 | 179 | .map(|(bands, color)| share_meter(bands.as_ref(), color, t)), |
| 180 | 180 | ) |
| 181 | 181 | .child( |
| 182 | - div() | |
| 183 | - .id("bar_ping_line") | |
| 182 | + band(space::SM) | |
| 183 | + .id("bar_ping") | |
| 184 | 184 | .flex_none() |
| 185 | - .w(px(size::ROW)) | |
| 186 | - .h(px(size::ICON)) | |
| 185 | + .h(px(size::CONTROL)) | |
| 186 | + .px(px(space::MD)) | |
| 187 | + .rounded_full() | |
| 188 | + .when(bar.stats, |ping| ping.bg(t.press())) | |
| 189 | + .hover({ | |
| 190 | + let hov = t.hov(); | |
| 191 | + move |style| style.bg(hov) | |
| 192 | + }) | |
| 187 | 193 | .cursor_pointer() |
| 188 | 194 | .tip("Connection stats") |
| 189 | - .on_click({ | |
| 190 | - let stats = run(&actions.stats); | |
| 191 | - move |_, window, cx| stats(window, cx) | |
| 192 | - }) | |
| 193 | - .child(super::parts::spark( | |
| 194 | - pings, | |
| 195 | - super::voice_stats::SAMPLE_HISTORY, | |
| 196 | - bar.quality.map_or(t.faint(), |quality| quality.color(t)), | |
| 197 | - )), | |
| 198 | - ) | |
| 199 | - .child( | |
| 200 | - div() | |
| 201 | - .flex_none() | |
| 202 | - .w(px(size::ROW)) | |
| 203 | - .flex() | |
| 204 | - .justify_end() | |
| 195 | + .on_click(move |_, window, cx| stats(window, cx)) | |
| 196 | + .child(div().w(px(size::ROW)).h(px(size::ICON)).child( | |
| 197 | + super::parts::spark( | |
| 198 | + pings, | |
| 199 | + super::voice_stats::SAMPLE_HISTORY, | |
| 200 | + bar.quality.map_or(t.faint(), |quality| quality.color(t)), | |
| 201 | + ), | |
| 202 | + )) | |
| 205 | 203 | .child( |
| 206 | - div() | |
| 207 | - .id("bar_ping") | |
| 208 | - .tip("Connection stats") | |
| 209 | - .cursor_pointer() | |
| 210 | - .when(bar.stats, |ping| { | |
| 211 | - ping.border_b(px(super::style::stroke::LINE)) | |
| 212 | - .border_color(t.paper()) | |
| 213 | - }) | |
| 214 | - .on_click(move |_, window, cx| stats(window, cx)) | |
| 215 | - .child(words(ping, Text::Label, ping_ink, t)), | |
| 204 | + words(ping, Text::Label, ping_ink, t) | |
| 205 | + .min_w(px(size::CHIP * 2.)) | |
| 206 | + .text_right(), | |
| 216 | 207 | ), |
| 217 | 208 | ) |
| 218 | 209 | .child(controls), |
crates/client/src/gui/chat.rsmodified+4 -1
| @@ -1460,7 +1460,10 @@ impl Yumush { | ||
| 1460 | 1460 | .max_w(relative(0.95)) |
| 1461 | 1461 | .max_h(relative(0.8)) |
| 1462 | 1462 | .overflow_y_scroll() |
| 1463 | - .p(px(space::XL)) | |
| 1463 | + .p(px(match at { | |
| 1464 | + StatsAt::Header => space::XL, | |
| 1465 | + StatsAt::Dock => space::LG, | |
| 1466 | + })) | |
| 1464 | 1467 | .rounded(px(radius::LG)) |
| 1465 | 1468 | .border_1() |
| 1466 | 1469 | .border_color(palette.border) |
crates/client/src/gui/voice_stats.rsmodified+3 -3
| @@ -21,7 +21,7 @@ use crate::voice::VoiceSample; | ||
| 21 | 21 | use common::stats::Stats; |
| 22 | 22 | |
| 23 | 23 | pub const SAMPLE_HISTORY: usize = 60; |
| 24 | -const LABEL_W: f32 = size::ROW * 2.; | |
| 24 | +const LABEL_W: f32 = size::ROW + space::LG; | |
| 25 | 25 | const VALUE_W: f32 = size::THUMB; |
| 26 | 26 | const COLUMN_W: f32 = size::TALK + size::ROW * 2.; |
| 27 | 27 | pub const PING_SCALE: f32 = 150.; |
| @@ -94,8 +94,8 @@ pub fn stats_panel( | ||
| 94 | 94 | let t = palette.tokens; |
| 95 | 95 | let share = &stats.share; |
| 96 | 96 | if detail == Detail::Connection { |
| 97 | - return stack(space::XL) | |
| 98 | - .w(px(COLUMN_W)) | |
| 97 | + return stack(space::LG) | |
| 98 | + .w(px(size::POPOVER)) | |
| 99 | 99 | .when(!stats.voice.is_empty(), |column| { |
| 100 | 100 | column.child(connection(stats, t)) |
| 101 | 101 | }) |