struct Layout {
thickness: i32,
min_height: i32,
x_height: i32,
padding: i32,
}Expand description
Layout measurements used by StackNavigationBar to compute bar sizes and spacing.
This small value object caches DPI- and font-dependent sizing parameters that are computed once and reused across layout and resizing logic:
thickness: thickness of the separator between bars (scaled by DPI)min_height: minimum allowed height for a bar (usually SMALL_BAR_HEIGHT - thickness)x_height: font x-height used to compute line heightspadding: extra vertical padding inside a bar (derived from min_height and x_height)
Keeping these values together makes it easier to reason about sizing and to pass a consistent set of layout metrics into functions that need them.
Fields§
§thickness: i32Thickness of the separators between bars (in pixels).
min_height: i32Minimum height of a bar (in pixels).
x_height: i32Font x-height used to compute per-line heights (in pixels).
padding: i32Vertical padding used inside bars (in pixels).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.