Struct zng_app::widget::border::BorderSides
source · pub struct BorderSides {
pub left: BorderSide,
pub right: BorderSide,
pub top: BorderSide,
pub bottom: BorderSide,
}
Expand description
The line style and color for each side of a widget’s border.
Fields§
§left: BorderSide
Color and style of the left border.
right: BorderSide
Color and style of the right border.
top: BorderSide
Color and style of the top border.
bottom: BorderSide
Color and style of the bottom border.
Implementations§
source§impl BorderSides
impl BorderSides
sourcepub fn new_all<S: Into<BorderSide>>(side: S) -> Self
pub fn new_all<S: Into<BorderSide>>(side: S) -> Self
All sides equal.
sourcepub fn new_vh<TB: Into<BorderSide>, LR: Into<BorderSide>>(
top_bottom: TB,
left_right: LR,
) -> Self
pub fn new_vh<TB: Into<BorderSide>, LR: Into<BorderSide>>( top_bottom: TB, left_right: LR, ) -> Self
Top-bottom and left-right equal.
sourcepub fn new<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>>(
top: T,
right: R,
bottom: B,
left: L,
) -> Self
pub fn new<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>>( top: T, right: R, bottom: B, left: L, ) -> Self
New top, right, bottom left.
sourcepub fn new_top<T: Into<BorderSide>>(top: T) -> Self
pub fn new_top<T: Into<BorderSide>>(top: T) -> Self
New top only, other sides hidden.
sourcepub fn new_right<R: Into<BorderSide>>(right: R) -> Self
pub fn new_right<R: Into<BorderSide>>(right: R) -> Self
New right only, other sides hidden.
sourcepub fn new_bottom<B: Into<BorderSide>>(bottom: B) -> Self
pub fn new_bottom<B: Into<BorderSide>>(bottom: B) -> Self
New bottom only, other sides hidden.
sourcepub fn new_left<L: Into<BorderSide>>(left: L) -> Self
pub fn new_left<L: Into<BorderSide>>(left: L) -> Self
New left only, other sides hidden.
All sides hidden.
sourcepub fn dimensions_eq(&self) -> bool
pub fn dimensions_eq(&self) -> bool
If top and bottom are equal; and left and right are equal.
Trait Implementations§
source§impl Clone for BorderSides
impl Clone for BorderSides
source§fn clone(&self) -> BorderSides
fn clone(&self) -> BorderSides
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BorderSides
impl Debug for BorderSides
source§impl<'de> Deserialize<'de> for BorderSides
impl<'de> Deserialize<'de> for BorderSides
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<C: Into<Rgba>, S: Into<BorderStyle>> From<(C, S)> for BorderSides
impl<C: Into<Rgba>, S: Into<BorderStyle>> From<(C, S)> for BorderSides
source§impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> From<(T, R, B, L)> for BorderSides
impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> From<(T, R, B, L)> for BorderSides
source§fn from((top, right, bottom, left): (T, R, B, L)) -> Self
fn from((top, right, bottom, left): (T, R, B, L)) -> Self
(top, right, bottom, left) sides.
source§impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> From<(T, R, B, L, S)> for BorderSides
impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> From<(T, R, B, L, S)> for BorderSides
source§fn from((top, right, bottom, left, style): (T, R, B, L, S)) -> Self
fn from((top, right, bottom, left, style): (T, R, B, L, S)) -> Self
(top-color, right-color, bottom-color, left-color, style) sides.
source§impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> From<(TB, LR, S)> for BorderSides
impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> From<(TB, LR, S)> for BorderSides
source§fn from((top_bottom, left_right, style): (TB, LR, S)) -> Self
fn from((top_bottom, left_right, style): (TB, LR, S)) -> Self
(top-bottom-color, left-right-color, style) sides.
source§impl From<BorderStyle> for BorderSides
impl From<BorderStyle> for BorderSides
source§fn from(style: BorderStyle) -> Self
fn from(style: BorderStyle) -> Self
All sides transparent black with the style.
This is only useful with BorderStyle::Hidden
variant.
source§impl<C: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (C, S)
impl<C: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (C, S)
source§impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> IntoVar<BorderSides> for (T, R, B, L)
impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> IntoVar<BorderSides> for (T, R, B, L)
source§impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (T, R, B, L, S)
impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (T, R, B, L, S)
source§impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (TB, LR, S)
impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (TB, LR, S)
source§impl IntoVar<BorderSides> for BorderStyle
impl IntoVar<BorderSides> for BorderStyle
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
All sides transparent black with the style.
This is only useful with BorderStyle::Hidden
variant.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<BorderSides> for Hsla
impl IntoVar<BorderSides> for Hsla
source§impl IntoVar<BorderSides> for Hsva
impl IntoVar<BorderSides> for Hsva
source§impl IntoVar<BorderSides> for Rgba
impl IntoVar<BorderSides> for Rgba
source§impl PartialEq for BorderSides
impl PartialEq for BorderSides
source§impl Serialize for BorderSides
impl Serialize for BorderSides
source§impl Transitionable for BorderSides
impl Transitionable for BorderSides
source§fn lerp(self, to: &Self, step: EasingStep) -> Self
fn lerp(self, to: &Self, step: EasingStep) -> Self
self
-> to
by step
.impl Copy for BorderSides
impl<C: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (C, S)
impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> IntoValue<BorderSides> for (T, R, B, L)
impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (T, R, B, L, S)
impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (TB, LR, S)
impl IntoValue<BorderSides> for BorderStyle
impl IntoValue<BorderSides> for Hsla
impl IntoValue<BorderSides> for Hsva
impl IntoValue<BorderSides> for Rgba
impl StructuralPartialEq for BorderSides
Auto Trait Implementations§
impl Freeze for BorderSides
impl RefUnwindSafe for BorderSides
impl Send for BorderSides
impl Sync for BorderSides
impl Unpin for BorderSides
impl UnwindSafe for BorderSides
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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