Skip to main content

Module status_bar

Module status_bar 

Expand description

The status bar: persistent status at the bottom edge of a window region.

What a person reads while working and expects to stay put (the cursor’s line and column, a word count, the number of unresolved conflicts) goes here, never into a floating bubble over the content. The bar reserves its band (split): the content above it is laid out in what is left, so nothing is ever painted under it.

The bar sits on its region’s ground (the framework paints that) with one hairline along its top edge; it is never a raised band. Each readout is a Caption with tabular figures in the secondary ink, inset by the content gutter step spacing.s4.

Structs§

StatusReadout
One readout of the status bar. A readout that does something when clicked (a zoom level that opens its menu, a line number that opens “Go to line”) is StatusReadout::action: it lifts under the pointer, and draw_readouts returns its rect for the host to hit-test.

Functions§

draw
Draw the status bar in bar (from split) with left- and right-aligned readouts. theme is the theme of the region the bar sits in (theme.in_region(..) for a sidebar or inspector).
draw_readouts
Draw the status bar in bar with left readouts from its leading edge and right readouts from its trailing edge, s4 apart. hovered is an index into left then right (as the returned rects are ordered). Returns each readout’s rect, for hit-testing the clickable ones.
height
Height of the status bar: the compact control height, so a status bar and a bar control read as the same tier, grown with the Caption line at a large text scale so the readouts always have s1 of air.
split
Reserve the status bar’s band at the bottom of region: returns (content, bar). Lay the region’s content out in content and draw the bar in bar.