Module window_header
Expand description
The window’s header row, as a capability: the one place window-level controls stand.
A widget that draws the header row across the top of the window
provides WindowHeader: NavShell does,
and so does a painted app that lays its top band out with
crate::chrome::HeaderRowFace. The host offers it the window’s own
controls (today: History) before it builds the app. App windows never add
a second header when the app declines this capability; History remains
available through the platform action, palette and keyboard.
A painted app keeps a HistoryOpener:
ⓘ
impl WindowHeader for Editor {
fn set_history_control(&mut self, control: Option<HistoryControl>) {
self.history.set_control(control);
}
}
// draw: let face = HeaderRowFace::new(area, theme).with_history_if(self.history.control().is_some());
// self.history.paint(scene, transform, text, theme, face.history_rect());
// events: if self.history.handle_event(event, face.history_rect(), ctx.scale_factor) { .. }
// ActionControls::take_control_invocation: self.history.take()Structs§
- Header
Status - The window’s sync status in a header row: quiet text, right-aligned
against the row’s trailing controls, announced politely when it changes.
A header row keeps one, paints it into the room its own layout leaves
(
Self::paint) and lists it among its children for assistive technology. - History
Opener - The window’s History control in a painted header row: what the host
offered, the pointer’s hover over it, and a press waiting to go through
the History door. Modelled on
crate::search::SearchOpener: returnSelf::takefromActionControls::take_control_invocation. - Status
Action - The button beside a window’s status: its label and the window’s own action it runs, the same one the palette, menus and assistive technology reach.
- Window
Bar - The window’s bar, as the host offers it to a header row.
- Window
BarSlot - A header row holding the window’s bar, after layout.
- Window
Status - What the window says about its changes in the header row: quiet text (“Working offline…”), and the one thing the person can do about it when there is one (Retry), as a button beside it.
Enums§
- History
Control - What the window’s History control shows.
Constants§
- HISTORY_
CONTROL_ ID - The id of the window’s History control in a painted header row: its test id, and the action target of its semantic node.
- STATUS_
ACTION_ ID - The test id of the button beside a window’s status.
Traits§
- Window
Header - A widget that draws the window’s header row.
- Window
History - An app that runs a History of its own inside a desktop window (an app shown in a region of the host’s scene). The window presents its History control in the tab row, as one more control of the window, so the app draws no History band of its own.