Trait WindowHeader
pub trait WindowHeader {
// Required method
fn set_history_control(&mut self, control: Option<HistoryControl>);
// Provided methods
fn set_window_presents_search(&mut self, presents: bool) -> bool { ... }
fn set_sync_status(&mut self, status: Option<&WindowStatus>) -> bool { ... }
fn set_window_bar(&mut self, bar: Option<WindowBar>) -> bool { ... }
fn window_bar_slot(&self) -> Option<WindowBarSlot> { ... }
}Expand description
A widget that draws the window’s header row.
Required Methods§
fn set_history_control(&mut self, control: Option<HistoryControl>)
fn set_history_control(&mut self, control: Option<HistoryControl>)
Show the window’s History control at the trailing edge of the row,
or none (None: the app has no History, or the host’s own chrome
presents it).
Provided Methods§
fn set_window_presents_search(&mut self, presents: bool) -> bool
fn set_window_presents_search(&mut self, presents: bool) -> bool
The window’s bar presents search for the window, in place
(crate::widget::WindowSearch), or stops (false). While it does,
the row drops its own button that opens the app’s search
(crate::search::APP_SEARCH_BUTTON_ID): one search control per
window. Returns whether the row took it.
fn set_sync_status(&mut self, status: Option<&WindowStatus>) -> bool
fn set_sync_status(&mut self, status: Option<&WindowStatus>) -> bool
Show the window’s sync status (“Working offline…”) as quiet text in the row, before its trailing controls, with its button (Retry) beside it when it has one, or none. Returns whether the row shows it; a row that does not leaves the host to present it.
fn set_window_bar(&mut self, bar: Option<WindowBar>) -> bool
fn set_window_bar(&mut self, bar: Option<WindowBar>) -> bool
Merge the window’s bar into this header row while the window is
maximized, or stop (None). The row reserves bar.controls_width at
its trailing end for the window’s controls, which the host paints
there when the person reaches for them, so the app’s header and the
window’s controls read as one bar instead of two stacked ones. A row
whose app put its header in the window’s bar
(WindowBarSlot::hides_with_bar) shows only while bar.revealed,
over the app’s content. Returns whether the row took the bar; a row
that does not leaves the host to float its controls over the window.
fn window_bar_slot(&self) -> Option<WindowBarSlot>
fn window_bar_slot(&self) -> Option<WindowBarSlot>
Where the row stands and where the window’s controls go, after layout, while it holds the window’s bar.