forge
Explore
Log in

Don't you dare go Hollow

💄 The picked equalizer band's handle is drawn larger, and the band pills wrap so 20 fit a docked card

Browse files at this commit

1e406a8d14cce9915117539d8de4d1c57201ab92Ahmet Kaan GümüşParent: 5a58c77
crates/app/src/ui/cards/eq.rsmodified+8 -8
@@ -115,13 +115,14 @@ impl Player {
115 .flex()115 .flex()
116 .items_center()116 .items_center()
117 .justify_center()117 .justify_center()
118- .child(118+ .child({
119+ let d = if i == self.eq_band { EQ_HANDLE * 1.6 } else { EQ_HANDLE };
119 div()120 div()
120- .w(px(EQ_HANDLE))121+ .w(px(d))
121- .h(px(EQ_HANDLE))122+ .h(px(d))
122- .rounded(px(EQ_HANDLE / 2.))123+ .rounded(px(d / 2.))
123- .bg(rgb(if i == self.eq_band { INK1() } else { INK3() })),124+ .bg(rgb(if i == self.eq_band { INK1() } else { INK3() }))
124- )125+ })
125 })126 })
126 .collect();127 .collect();
127 // Maximized used to claim a fixed 320 px slice for the graph128 // Maximized used to claim a fixed 320 px slice for the graph
@@ -424,10 +425,9 @@ impl Player {
424 )425 )
425 .child(numedit::field(id, name, target, f64::from(value), cx))426 .child(numedit::field(id, name, target, f64::from(value), cx))
426 };427 };
427- // The band is picked from a row of pills, one per band, numbered by position.
428 let count = self.eq_params.bands.len();428 let count = self.eq_params.bands.len();
429 let pills: Vec<kit::Segment> = (1..=count).map(|i| kit::Segment::text(i.to_string())).collect();429 let pills: Vec<kit::Segment> = (1..=count).map(|i| kit::Segment::text(i.to_string())).collect();
430- let picker = kit::segmented_equal("eq-band", &pills, self.eq_band, true, None, {430+ let picker = kit::segmented_wrap("eq-band", &pills, self.eq_band, true, None, {
431 let me = cx.entity();431 let me = cx.entity();
432 move |i, _, app| {432 move |i, _, app| {
433 me.update(app, |this, cx| {433 me.update(app, |this, cx| {