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 {
179 .map(|(bands, color)| share_meter(bands.as_ref(), color, t)),179 .map(|(bands, color)| share_meter(bands.as_ref(), color, t)),
180 )180 )
181 .child(181 .child(
182- div()182+ band(space::SM)
183- .id("bar_ping_line")183+ .id("bar_ping")
184 .flex_none()184 .flex_none()
185- .w(px(size::ROW))185+ .h(px(size::CONTROL))
186- .h(px(size::ICON))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 .cursor_pointer()193 .cursor_pointer()
188 .tip("Connection stats")194 .tip("Connection stats")
189- .on_click({195+ .on_click(move |_, window, cx| stats(window, cx))
190- let stats = run(&actions.stats);196+ .child(div().w(px(size::ROW)).h(px(size::ICON)).child(
191- move |_, window, cx| stats(window, cx)197+ super::parts::spark(
192- })198+ pings,
193- .child(super::parts::spark(199+ super::voice_stats::SAMPLE_HISTORY,
194- pings,200+ bar.quality.map_or(t.faint(), |quality| quality.color(t)),
195- super::voice_stats::SAMPLE_HISTORY,201+ ),
196- bar.quality.map_or(t.faint(), |quality| quality.color(t)),202+ ))
197- )),
198- )
199- .child(
200- div()
201- .flex_none()
202- .w(px(size::ROW))
203- .flex()
204- .justify_end()
205 .child(203 .child(
206- div()204+ words(ping, Text::Label, ping_ink, t)
207- .id("bar_ping")205+ .min_w(px(size::CHIP * 2.))
208- .tip("Connection stats")206+ .text_right(),
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)),
216 ),207 ),
217 )208 )
218 .child(controls),209 .child(controls),
crates/client/src/gui/chat.rsmodified+4 -1
@@ -1460,7 +1460,10 @@ impl Yumush {
1460 .max_w(relative(0.95))1460 .max_w(relative(0.95))
1461 .max_h(relative(0.8))1461 .max_h(relative(0.8))
1462 .overflow_y_scroll()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 .rounded(px(radius::LG))1467 .rounded(px(radius::LG))
1465 .border_1()1468 .border_1()
1466 .border_color(palette.border)1469 .border_color(palette.border)
crates/client/src/gui/voice_stats.rsmodified+3 -3
@@ -21,7 +21,7 @@ use crate::voice::VoiceSample;
21 use common::stats::Stats;21 use common::stats::Stats;
22 22
23 pub const SAMPLE_HISTORY: usize = 60;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 const VALUE_W: f32 = size::THUMB;25 const VALUE_W: f32 = size::THUMB;
26 const COLUMN_W: f32 = size::TALK + size::ROW * 2.;26 const COLUMN_W: f32 = size::TALK + size::ROW * 2.;
27 pub const PING_SCALE: f32 = 150.;27 pub const PING_SCALE: f32 = 150.;
@@ -94,8 +94,8 @@ pub fn stats_panel(
94 let t = palette.tokens;94 let t = palette.tokens;
95 let share = &stats.share;95 let share = &stats.share;
96 if detail == Detail::Connection {96 if detail == Detail::Connection {
97- return stack(space::XL)97+ return stack(space::LG)
98- .w(px(COLUMN_W))98+ .w(px(size::POPOVER))
99 .when(!stats.voice.is_empty(), |column| {99 .when(!stats.voice.is_empty(), |column| {
100 column.child(connection(stats, t))100 column.child(connection(stats, t))
101 })101 })