Skip to main content

nav_list_width_fitting

Function nav_list_width_fitting 

pub fn nav_list_width_fitting<'a>(
    theme: &Theme,
    text_renderer: &mut TextRenderer,
    labels: impl IntoIterator<Item = &'a str>,
) -> f64
Expand description

How wide an icon-led list of these destination labels must be for every label to stand whole beside its icon: the row’s padding, its icon and gap, and the widest label. Where a sidebar is narrower than this, its destinations read better as a rail’s tiles than as cut-off rows, so this is where a navigation sidebar turns from rail into list.