Struct HeaderRowFace
pub struct HeaderRowFace {
pub row: Rect,
pub toggle: Rect,
pub back: Rect,
pub title: Rect,
pub actions: Rect,
pub history: Rect,
pub trailing: Rect,
pub rule: Rect,
/* private fields */
}Expand description
The geometry of one header row. See the module docs.
Fields§
§row: RectThe whole row.
toggle: RectThe sidebar toggle, or Rect::ZERO.
back: RectThe Back button, or Rect::ZERO.
title: RectWhere the title may stand: from the title’s start to the trailing buttons. The title takes its measured width from the leading end.
actions: RectWhere the column’s actions may stand, trailing-aligned: the same run
as the title until Self::split gives the title its width.
history: RectThe window’s History control, or Rect::ZERO.
trailing: RectA trailing shell button before History (the inspector toggle), or
Rect::ZERO.
rule: RectThe hairline under the row, or Rect::ZERO for a row without one (a
sidebar, a drawer).
Implementations§
§impl HeaderRowFace
impl HeaderRowFace
pub fn new(area: Rect, theme: &Theme) -> HeaderRowFace
pub fn new(area: Rect, theme: &Theme) -> HeaderRowFace
The header row across the top of area, with a rule under it and no
shell buttons yet.
pub fn metrics(&self) -> HeaderRowMetrics
pub fn with_toggle(self) -> HeaderRowFace
pub fn with_toggle(self) -> HeaderRowFace
Put the sidebar toggle at the row’s leading corner.
pub fn with_back(self) -> HeaderRowFace
pub fn with_back(self) -> HeaderRowFace
Put a Back button at the leading edge, after the toggle.
pub fn with_history(self) -> HeaderRowFace
pub fn with_history(self) -> HeaderRowFace
Put the window’s History control in the row’s trailing corner (a trailing chip placed before it moves one place in).
pub fn with_history_if(self, shown: bool) -> HeaderRowFace
pub fn with_history_if(self, shown: bool) -> HeaderRowFace
Self::with_history where the host offered the window’s History
control (shown: crate::widget::HistoryOpener::is_shown).
pub fn with_trailing(self) -> HeaderRowFace
pub fn with_trailing(self) -> HeaderRowFace
A trailing shell button before History (an inspector toggle).
pub fn with_inset_title(self) -> HeaderRowFace
pub fn with_inset_title(self) -> HeaderRowFace
Start the title at the shell buttons’ inset instead of the content gutter (a sidebar’s title lines up with its rows, not with content).
pub fn body_of(&self, area: Rect) -> Rect
pub fn body_of(&self, area: Rect) -> Rect
The area under the row: what a painted app lays its content in.
pub fn history_rect(&self) -> Rect
pub fn history_rect(&self) -> Rect
The History control’s rect: where a painted app paints
paint_history_control and routes its presses.
pub fn split(&self, width: f64) -> (Rect, Rect)
pub fn split(&self, width: f64) -> (Rect, Rect)
Give the title width (its measured width) and the actions what is
left after it: (title, actions).
pub fn paint_rule(&self, scene: &mut Scene, transform: Affine, theme: &Theme)
pub fn paint_rule(&self, scene: &mut Scene, transform: Affine, theme: &Theme)
Paint the rule under the row on theme’s ground.
pub fn paint_title(
&self,
scene: &mut Scene,
transform: Affine,
text: &mut TextRenderer,
theme: &Theme,
title: &str,
count: Option<usize>,
actions_x0: Option<f64>,
)
pub fn paint_title( &self, scene: &mut Scene, transform: Affine, text: &mut TextRenderer, theme: &Theme, title: &str, count: Option<usize>, actions_x0: Option<f64>, )
Paint title (and a quiet count after it) in the title band,
elided to fit before actions_x0, the leading edge of what the
actions took (None: the whole band).
Trait Implementations§
§impl Clone for HeaderRowFace
impl Clone for HeaderRowFace
§fn clone(&self) -> HeaderRowFace
fn clone(&self) -> HeaderRowFace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HeaderRowFace
impl Debug for HeaderRowFace
§impl PartialEq for HeaderRowFace
impl PartialEq for HeaderRowFace
impl Copy for HeaderRowFace
impl StructuralPartialEq for HeaderRowFace
Auto Trait Implementations§
impl Freeze for HeaderRowFace
impl RefUnwindSafe for HeaderRowFace
impl Send for HeaderRowFace
impl Sync for HeaderRowFace
impl Unpin for HeaderRowFace
impl UnsafeUnpin for HeaderRowFace
impl UnwindSafe for HeaderRowFace
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more