Skip to main content

bar_button

Function bar_button 

Source
pub fn bar_button(icon: &'static [u8], diameter: f32, tint: Hsla) -> Div
Expand description

A circular control inside a bar: the ring, and its glyph at half the diameter. diameter is a parameter because a transport’s primary action is deliberately bigger than its neighbours — that size difference is what makes the cluster readable at a glance.

It builds the icon rather than taking one, the way row_icon does, because tint is not optional in the way it looks: gpui reads an svg’s colour off that element’s own style and paints nothing when it is unset, so a colour set on this button would silently not reach the glyph.

Caller adds id, click and its own .hover(..): gpui panics on a second hover call, and the wash differs by state (a lit toggle is not a resting one). Theme::element_hover is the wash to reach for.