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§

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.

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.

Traits§

WindowHeader
A widget that draws the window’s header row.