Struct RailMetrics
pub struct RailMetrics {
pub pad: f64,
pub gap: f64,
pub num_gutter: f64,
pub header_h: f64,
pub add_h: f64,
pub add_margin: f64,
pub menu_w: f64,
pub menu_row_h: f64,
pub menu_sep_h: f64,
pub menu_pad: f64,
pub menu_row_inset: f64,
}Expand description
The rail’s geometry, on the spacing scale. RailMetrics::DEFAULT
restates the scale as the constants above — what
PageSidebar::begin_frame has always laid out with, for a host that
runs its layout pass without a Theme. A host that has one calls
PageSidebar::begin_frame_with_theme and the same values are read
from theme.tokens instead, so a density change reaches the rail.
Fields§
§pad: f64Inset around the list and the header label (spacing.s3).
gap: f64Vertical gap between thumbnails (spacing.s3).
num_gutter: f64Width of the page-number gutter left of the thumbnails (spacing.s6).
header_h: f64Height of the panel header band (spacing.s8).
add_h: f64Height of the bottom add button (metrics.bar_height when themed;
the restated default is 36).
add_margin: f64Gap under the add button, to the rail’s bottom edge (spacing.s2).
Width of the context-menu popover (no token; the constant is kept).
Height of one menu row (spacing.s8).
Height of the separator before Delete (spacing.s2).
Padding above the first and below the last menu row (spacing.s2).
Inset of a menu row, and of the menu from the rail’s edges (spacing.s1).
Implementations§
§impl RailMetrics
impl RailMetrics
pub const DEFAULT: RailMetrics
pub const DEFAULT: RailMetrics
The spacing scale restated, for a layout pass with no Theme.
pub fn from_theme(theme: &Theme) -> RailMetrics
pub fn from_theme(theme: &Theme) -> RailMetrics
The same geometry read from the theme’s tokens. The add button is a
bar button (metrics.bar_height) rather than the restated 36; the
menu width has no token and keeps its constant.
Trait Implementations§
§impl Clone for RailMetrics
impl Clone for RailMetrics
§fn clone(&self) -> RailMetrics
fn clone(&self) -> RailMetrics
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 RailMetrics
impl Debug for RailMetrics
§impl Default for RailMetrics
impl Default for RailMetrics
§fn default() -> RailMetrics
fn default() -> RailMetrics
§impl PartialEq for RailMetrics
impl PartialEq for RailMetrics
impl Copy for RailMetrics
impl StructuralPartialEq for RailMetrics
Auto Trait Implementations§
impl Freeze for RailMetrics
impl RefUnwindSafe for RailMetrics
impl Send for RailMetrics
impl Sync for RailMetrics
impl Unpin for RailMetrics
impl UnsafeUnpin for RailMetrics
impl UnwindSafe for RailMetrics
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