pub struct Container<T> { /* private fields */ }
Expand description
A widget that provides simple visual styling options to a child.
Implementations§
source§impl<T: Data> Container<T>
impl<T: Data> Container<T>
sourcepub fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Self
pub fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Self
Builder-style method for setting the background for this widget.
This can be passed anything which can be represented by a BackgroundBrush
;
notably, it can be any Color
, a Key<Color>
resolvable in the Env
,
any gradient, or a fully custom Painter
widget.
sourcepub fn set_background(&mut self, brush: impl Into<BackgroundBrush<T>>)
pub fn set_background(&mut self, brush: impl Into<BackgroundBrush<T>>)
Set the background for this widget.
This can be passed anything which can be represented by a BackgroundBrush
;
notably, it can be any Color
, a Key<Color>
resolvable in the Env
,
any gradient, or a fully custom Painter
widget.
sourcepub fn clear_background(&mut self)
pub fn clear_background(&mut self)
Clears background.
sourcepub fn border(
self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>
) -> Self
pub fn border(
self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>
) -> Self
Builder-style method for painting a border around the widget with a color and width.
Arguments can be either concrete values, or a Key
of the respective
type.
sourcepub fn set_border(
&mut self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>
)
pub fn set_border(
&mut self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>
)
Paint a border around the widget with a color and width.
Arguments can be either concrete values, or a Key
of the respective
type.
sourcepub fn clear_border(&mut self)
pub fn clear_border(&mut self)
Clears border.
sourcepub fn rounded(self, radius: impl Into<KeyOrValue<RoundedRectRadii>>) -> Self
pub fn rounded(self, radius: impl Into<KeyOrValue<RoundedRectRadii>>) -> Self
Builder style method for rounding off corners of this container by setting a corner radius
sourcepub fn set_rounded(&mut self, radius: impl Into<KeyOrValue<RoundedRectRadii>>)
pub fn set_rounded(&mut self, radius: impl Into<KeyOrValue<RoundedRectRadii>>)
Round off corners of this container by setting a corner radius