Skip to main content

Module header_row

Module header_row 

Expand description

The window’s header row as a face: one geometry for NavShell and for every painted app.

Windows have no title bar; the top band of the window is the header row (HIG §1, “The header row”). crate::widget::NavShell draws it for widget apps. A painted app that owns its whole surface builds a HeaderRowFace for the same band and gets the same rects the shell uses:

  • the row itself, metrics.header_height tall (grown with the text the way a one-line control grows);
  • the leading shell buttons: the sidebar toggle and Back, Plain icon buttons of min_pointer_target in the s3 inset;
  • the title band: Heading in sentence case, starting at the content gutter, or just after the leading buttons;
  • the actions band: from the end of the title to the trailing buttons;
  • the trailing buttons: the window’s History control in the top-trailing corner (HeaderRowFace::history_rect), any other trailing chip before it;
  • the rule: one hairline under a content column’s row.
ⓘ
let face = HeaderRowFace::new(area, theme).with_toggle().with_history();
face.paint_rule(scene, transform, theme);
face.paint_title(scene, transform, text, theme, "Report.pdf", None);
chrome::paint_history_control(scene, transform, text, theme, face.history_rect(), control, hovered);
let body = face.body();

Structs§

HeaderRowFace
The geometry of one header row. See the module docs.
HeaderRowMetrics
The header row’s sizes, resolved against one theme.

Functions§

paint_history_control
Paint the window’s History control in rect: the History glyph as a Plain icon button, on (the selection lift) while History shows. The same face NavShell and the window’s own bar draw; a painted app routes its presses through a crate::widget::HistoryOpener.