Skip to main content

Module toolbar

Module toolbar 

Expand description

The toolbar: a measured strip of commands with a shared ContextMenu for overflow, so every command stays reachable however narrow the window. The extent cache is the sole source for intrinsic sizing, fitting and placement.

Commands are Label-role plain buttons; a toggle that is on is a lift; groups are split by hairline separators that never stand at the start or end of what is shown. A command can be disabled (dimmed, announced as disabled, inert), carry a dot (something new behind it), open a menu of its own, or rank above its neighbours for staying out of the More menu (Toolbar::with_priority). Hosted controls (a segmented strip, a number field, a colour well) stand in the row with Toolbar::push_element. A painted widget hosts one with Toolbar::lay_out_in (or Toolbar::lay_out_at once it has been measured). The band behind a window’s toolbar row is paint_band with its controls inset by band_padding.

Structs§

Toolbar
ToolbarButtonProps
One command of a toolbar: pressing it does one thing, or opens its menu.
ToolbarCommand
One command of a toolbar and what it carries.
ToolbarProps
A strip of commands: plain buttons in a row, groups split by hairlines, toggles that stand lifted while on. However narrow the window, every command stays reachable: those that do not fit go to a More menu at the end, the least important first.
ToolbarSeparatorProps
A hairline between groups of a toolbar’s commands. It never stands at the start or the end of what is shown.
ToolbarSpacerProps
The room left in a toolbar, between the commands before it and those after it, which it pushes to the far end.

Enums§

Orientation
ToolbarItem
ToolbarPart
One part of a toolbar: a command, a separator or a spacer.

Functions§

band_padding
The inset of a toolbar band’s controls from its edges: siblings’ step across, the tightest step above and below so the band stays one control tall (HIG §7b).
paint_band
The band behind a window’s toolbar row: no fill of its own (the toolbar stands on its region’s ground) and one derived hairline along its bottom edge, at metrics.chrome_rule_px.

Type Aliases§

GlyphPainter
Paints a command’s mark into the glyph square it is given.