pub struct Separator { /* private fields */ }Expand description
A horizontal divider line.
Renders a 1 px (default) line across the full width of its layout rect,
with vertical padding above and below. Use to break a column into
visual sections — between settings groups, list categories or content
blocks. The line takes the divider colour from the active theme by
default; override with Self::color for custom palettes.
// In view():
column()
.push( text( "General" ) )
.push( separator() )
.push( text( "Network" ) )
.into()Implementations§
Source§impl Separator
impl Separator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a separator with the theme’s default divider colour and 1 px thickness.
Sourcepub fn color(self, color: Color) -> Self
pub fn color(self, color: Color) -> Self
Override the stroke colour. Useful for emphasised dividers between destructive actions.
Sourcepub fn thickness(self, t: impl Into<Length>) -> Self
pub fn thickness(self, t: impl Into<Length>) -> Self
Override the line thickness. Accepts logical f32 pixels or any
Length. Without this it follows the widget-scaling mode.
Sourcepub fn pad_v(self, p: impl Into<Length>) -> Self
pub fn pad_v(self, p: impl Into<Length>) -> Self
Override the vertical padding above and below the line. Accepts
logical f32 pixels or any Length; pass 0.0 for a flush,
padding-less divider. Without this it follows the widget-scaling mode.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Separator
impl RefUnwindSafe for Separator
impl Send for Separator
impl Sync for Separator
impl Unpin for Separator
impl UnwindSafe for Separator
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
§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