Skip to main content

Module window_header

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§

HeaderStatus
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.
HistoryOpener
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: return Self::take from ActionControls::take_control_invocation.
StatusAction
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.
WindowBar
The window’s bar, as the host offers it to a header row.
WindowBarSlot
A header row holding the window’s bar, after layout.
WindowStatus
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§

HistoryControl
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§

WindowHeader
A widget that draws the window’s header row.
WindowHistory
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.