forge
Explore
Log in

Don't you dare go Hollow

Ping spark and ms merge into one connection-stats pill, dock stats sheet narrower (popover width, tighter padding and labels)

Browse files at this commit

83ff682a7a8de488863ff0d45fb14cd2d708f4b5Ahmet Kaan GümüşParent: b4baec8
  • style
    • ping spark and ms merge into one connection-stats pill, dock stats sheet narrower (popover width, tighter padding and labels)
Show full message
💄 style: ping spark and ms merge into one connection-stats pill, dock stats sheet narrower (popover width, tighter padding and labels)
crates/client/src/gui/call_bar.rsmodified+21 -30
@@ -179,40 +179,31 @@ pub fn view(bar: CallBar, actions: CallActions, t: Tokens) -> Div {
179179 .map(|(bands, color)| share_meter(bands.as_ref(), color, t)),
180180 )
181181 .child(
182- div()
183- .id("bar_ping_line")
182+ band(space::SM)
183+ .id("bar_ping")
184184 .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+ })
187193 .cursor_pointer()
188194 .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+ ))
205203 .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(),
216207 ),
217208 )
218209 .child(controls),
crates/client/src/gui/chat.rsmodified+4 -1
@@ -1460,7 +1460,10 @@ impl Yumush {
14601460 .max_w(relative(0.95))
14611461 .max_h(relative(0.8))
14621462 .overflow_y_scroll()
1463- .p(px(space::XL))
1463+ .p(px(match at {
1464+ StatsAt::Header => space::XL,
1465+ StatsAt::Dock => space::LG,
1466+ }))
14641467 .rounded(px(radius::LG))
14651468 .border_1()
14661469 .border_color(palette.border)
crates/client/src/gui/voice_stats.rsmodified+3 -3
@@ -21,7 +21,7 @@ use crate::voice::VoiceSample;
2121 use common::stats::Stats;
2222
2323 pub const SAMPLE_HISTORY: usize = 60;
24-const LABEL_W: f32 = size::ROW * 2.;
24+const LABEL_W: f32 = size::ROW + space::LG;
2525 const VALUE_W: f32 = size::THUMB;
2626 const COLUMN_W: f32 = size::TALK + size::ROW * 2.;
2727 pub const PING_SCALE: f32 = 150.;
@@ -94,8 +94,8 @@ pub fn stats_panel(
9494 let t = palette.tokens;
9595 let share = &stats.share;
9696 if detail == Detail::Connection {
97- return stack(space::XL)
98- .w(px(COLUMN_W))
97+ return stack(space::LG)
98+ .w(px(size::POPOVER))
9999 .when(!stats.voice.is_empty(), |column| {
100100 column.child(connection(stats, t))
101101 })