Struct Metrics
pub struct Metrics {Show 77 fields
pub bar_height: f32,
pub bar_control_height: f32,
pub panel_row_height: f32,
pub menu_row_height: f32,
pub menu_min_width: f32,
pub scrollbar_gutter: f32,
pub selector_height: f32,
pub min_pointer_target: f32,
pub panel_width_utility: f32,
pub panel_width_list: f32,
pub panel_width_sheet: f32,
pub icon_sm: f32,
pub icon_md: f32,
pub icon_lg: f32,
pub icon_label_gap: f32,
pub chrome_rule_px: f32,
pub call_edge_px: f32,
pub alert_edge_px: f32,
pub sidebar_width: f32,
pub drawer_width: f32,
pub overview_width: f32,
pub overview_max_width: f32,
pub compact_breakpoint: f32,
pub nav_row_height: f32,
pub header_height: f32,
pub rail_width: f32,
pub rail_max_width: f32,
pub inspector_width: f32,
pub sidebar_min_width: f32,
pub panel_min_width: f32,
pub sidebar_max_width: f32,
pub content_min_width: f32,
pub detail_min_width: f32,
pub window_min_width: f32,
pub list_min_width: f32,
pub reading_min_width: f32,
pub page_min_width: f32,
pub grid_min_width: f32,
pub board_lane_width: f32,
pub layout_hysteresis: f32,
pub readable_width: f32,
pub reading_measure: f32,
pub message_measure: f32,
pub chooser_width: f32,
pub field_min_width: f32,
pub wheel_line: f32,
pub scroll_thumb: f32,
pub swipe_commit: f32,
pub row_single: f32,
pub row_double: f32,
pub row_avatar: f32,
pub icon_control: f32,
pub icon_bar: f32,
pub avatar_inline: f32,
pub avatar_row: f32,
pub location_min_width: f32,
pub location_comfortable_width: f32,
pub note_wrap_width: f32,
pub sheet_max_height: f32,
pub listing_row_height: f32,
pub face_stack: f32,
pub face_stack_step: f32,
pub overview_panel_width: f32,
pub overview_picture_min_width: f32,
pub row_action_width: f32,
pub row_arrow: f32,
pub row_slider_width: f32,
pub row_slider_min_width: f32,
pub row_slider_valued_width: f32,
pub meter_height: f32,
pub chart_height: f32,
pub aside_min_width: f32,
pub figure_size: f32,
pub picture_tile_min_width: f32,
pub picture_tile_width: f32,
pub click_slop: f32,
pub drag_line_px: f32,
}Expand description
Reference density (HIG §9.6), unscaled. Read live values from
theme.tokens.metrics.
Fields§
§bar_height: f32A top bar, toolbar or status strip. Also the default height of the
shared Button and Dropdown controls.
bar_control_height: f32A control living inside a 40 px bar (segmented switch, bar button).
panel_row_height: f32One row of a Panel — a settings toggle row, a roster entry.
One row of a menu (context menu, dropdown list).
The narrowest a menu stands, however short its labels: a menu of one short item still reads as a menu, not as a button.
scrollbar_gutter: f32Room a scroll view keeps on its trailing edge for its scroll bar
while its content overflows, so the bar never covers content: the
thumb (Metrics::scroll_thumb) plus s1 on each side.
selector_height: f32A compact selector (chip, tab pill, dropdown trigger in a Panel).
min_pointer_target: f32No pointer target is smaller than this, whatever glyph it shows.
panel_width_utility: f32A utility Panel such as quick settings.
panel_width_list: f32§panel_width_sheet: f32A sheet carrying a form.
icon_sm: f32Compact glyph: tab leading icon, inline status mark.
icon_md: f32The standard 20 px glyph that sits in a 32 px hit rect.
icon_lg: f32Large glyph: empty-state mark, list leading icon.
icon_label_gap: f32Between an icon and the label it belongs to (Button, Tabs).
chrome_rule_px: f32Thickness of the rule under a toolbar and along a status bar.
1 is the hairline. 0 draws no rule. A heavier value is a
stronger chrome edge. ui_scale multiplies it; a theme’s spacing
preference does not.
call_edge_px: f32The edge a display wears while a call rings on another one.
alert_edge_px: f32The edge every display wears for a visual alert: obvious without a full-screen flash.
A genuine navigation sidebar (HIG §1a) when docked.
drawer_width: f32An overlay drawer; equal to Metrics::panel_width_utility so a
docked utility panel and a slid-in drawer are one width.
overview_width: f32The overview column of an overview + detail pair (HIG §1b).
overview_max_width: f32The widest the overview column grows to fit what it lists: a row’s title beside its facts, whole. Past it the title elides, and the detail keeps the room.
compact_breakpoint: f32A generic “wide window” width for painted apps that pick a compact
chrome by width: sidebar_width plus Metrics::content_min_width.
NavShell and SidebarDrawer dock by the content’s real minimum
instead.
One row of a navigation list (NavList, paint_nav_row) at the
default text scale; it grows with the body line like any shell
control that carries one line of text.
header_height: f32The one header row a NavShell draws across the top of the window:
a min_pointer_target control in an s3 inset (32 + 2 × 12).
rail_width: f32A compact icon-over-label navigation rail (NavList::rail).
rail_max_width: f32The widest a rail grows as the text grows, to fit its longest single
word (crate::chrome::rail_width_fitting); past it a word elides.
inspector_width: f32The inspector column at the trailing edge of a window.
Narrowest a person can drag a docked sidebar; dragging it below this
hides it. The same width a docked panel keeps beside a content column
before it floats over it (Self::panel_min_width).
panel_min_width: f32The narrowest a sidebar or panel works at beside a painted app’s own
content column, as a split of the app’s window: a name beside its
value, a destination’s label whole. Beside a content kind’s minimum
a shell panel shrinks toward this first
(SidebarDrawer::content_kind) and stops docking there.
Widest a person can drag a docked sidebar.
content_min_width: f32A generous content column: the width of a sheet
(Metrics::panel_width_sheet). Painted apps that split their own
window use it; NavShell docks by the content’s real minimum
instead (the *_min_width metrics of its ContentKind).
detail_min_width: f32Narrowest a detail column beside a list may become in a painted
app’s own split. NavShell uses its content kind’s minimum.
window_min_width: f32Narrowest a Tilo app’s window becomes: its compact layout, one screen
at a time, at phone width. Resizing a window stops its edge here
(widget::edge_resize), so every app’s compact layout must fit it.
list_min_width: f32The narrowest a list or table of items (files, messages, tracks) still works at: name, a line of detail, a trailing value.
reading_min_width: f32The narrowest a reading column (a message, an article) still works at: about 45 characters of body text.
page_min_width: f32The narrowest a page of settings, a form or a page of facts still works at: a label above its control.
grid_min_width: f32The narrowest a grid of media tiles still works at: two tiles.
board_lane_width: f32A board lane’s reading width: a card and its facts on one comfortable measure, the same on every board at every window width. Lanes stand left-aligned, as wide as this; the room a wider pane leaves stands open beside them instead of stretching every card across it.
layout_hysteresis: f32How much wider than its threshold a window must grow before a layout that switched away switches back, so a window resized near a threshold does not flicker between two layouts.
readable_width: f32The widest a form, a settings page or a page of facts grows
(FormPage, Page, PropertyList, Container::readable). Wider
windows leave the extra room beside it.
reading_measure: f32The line length of long-form reading text (documents, books, notes):
about 66 characters of the Reading role at the stock text size.
message_measure: f32The longest line a short message runs to (an empty state’s title and message), so a wide window wraps it under its title instead of stretching one sentence across the whole width.
chooser_width: f32The width a compact chooser (dropdown, segmented switch, single-line entry) keeps beside its label in a form row.
field_min_width: f32The narrowest a text field stands where nothing else sets its width: a row that wraps or a run that hugs its items lays a field out at its own width, which is this, grown with the text. Never zero, so a field always has room for a few words of what is typed.
wheel_line: f32How far one notch of a line-stepping wheel scrolls.
scroll_thumb: f32Thickness of a scroll bar’s thumb at rest; the bar’s gutter is the
thumb plus s1 on each side.
swipe_commit: f32How far a row must be swiped sideways before letting go commits its swipe action rather than springing back.
row_single: f32A one-line list row (super::Density::rows).
row_double: f32A list row with a title and a secondary line.
row_avatar: f32A list row led by a 40 px avatar or icon.
icon_control: f32A glyph in a row or a control: Lucide at 16.
icon_bar: f32The leading app or location icon of a bar.
avatar_inline: f32§avatar_row: f32An avatar leading a two-line row: the row grows to
Self::row_avatar.
location_min_width: f32A bar’s location field narrower than this is not shown: the bar keeps its buttons.
location_comfortable_width: f32A bar’s actions move into its overflow menu, last first, while its location field would be narrower than this.
note_wrap_width: f32Widest a short explanatory sentence (an arrival note, a hint under a heading) runs before it wraps.
sheet_max_height: f32The tallest a listing sheet (a directory of workspaces) grows.
listing_row_height: f32A listing’s row: a 40 px mark beside a title, a line and who is there.
face_stack: f32One face in a row’s stack of who is here now.
face_stack_step: f32How far each face in a row’s stack stands past the one before.
overview_panel_width: f32The overview’s panel of workspaces beside the picture of the windows.
overview_picture_min_width: f32The narrowest picture of the windows worth placing beside the overview’s panel; a narrower display holds it inside the panel.
row_action_width: f32A row’s named action button at its trailing end.
row_arrow: f32A small arrow button in a row (a placement step).
row_slider_width: f32A slider at a row’s trailing end (an app’s volume).
row_slider_min_width: f32§row_slider_valued_width: f32A row’s slider with its value beside it (the output volume).
meter_height: f32A level meter’s bar, at the default text size.
chart_height: f32A pane’s chart (charge history), at the default text size.
aside_min_width: f32The narrowest a list beside a figure gets before it moves under it.
figure_size: f32A pane’s figure (the time-zone globe), at the default text size.
picture_tile_min_width: f32The narrowest picture tile a chooser shows (a theme or wallpaper preview) before its grid drops a column.
picture_tile_width: f32The width a picture tile asks for when nothing bounds its grid.
click_slop: f32How far a press may move and still be a click.
drag_line_px: f32The line a drag draws where the dragged item would land, and the outline of the ghost it carries under the pointer.
Implementations§
§impl Metrics
impl Metrics
pub fn text_growth(text_scale: f32) -> f32
pub fn text_growth(text_scale: f32) -> f32
The factor a text-sized width or breakpoint grows by at a given
accessibility text scale: text_scale.max(1.0).
A destination list, an overview column and the window width at which
two panes still fit side by side are all sized by the text they hold,
so they grow with the text — but never shrink below their authored
1× geometry, where the rows, hit targets and paddings were designed.
This is the one rule the responsive shells (NavShell,
SidebarDrawer) apply to their inputs
(crate::Theme::responsive_scale), so an app never restates it.
A non-finite scale counts as 1×.
pub fn icon_growth(text_scale: f32) -> f32
pub fn icon_growth(text_scale: f32) -> f32
The factor the glyph metrics (icon_sm, icon_md, icon_lg) grow
by at a given accessibility text scale: the square root of
Self::text_growth. A glyph sits beside the text it labels, so it
grows with it, as symbols follow Dynamic Type; it grows less than the
letters, since a glyph already reads at a smaller size than a word and
still has to fit the control the text has grown. 2x text gives
glyphs about 1.41x. Never below 1.
pub fn with_icons_scaled(self, factor: f32) -> Metrics
pub fn with_icons_scaled(self, factor: f32) -> Metrics
These metrics with the glyph sizes multiplied by factor; see
Self::icon_growth.
Trait Implementations§
impl Copy for Metrics
impl StructuralPartialEq for Metrics
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more