pub struct Container {
pub background: Option<Color>,
pub corner_radius: CornerRadius,
pub padding: f32,
pub min_width: Option<f32>,
pub min_height: Option<f32>,
pub max_width: Option<f32>,
pub max_height: Option<f32>,
/* private fields */
}Expand description
Container widget for grouping and styling children.
Fields§
§background: Option<Color>Background color
corner_radius: CornerRadiusCorner radius for rounded corners
padding: f32Padding (all sides)
min_width: Option<f32>Minimum width constraint
min_height: Option<f32>Minimum height constraint
max_width: Option<f32>Maximum width constraint
max_height: Option<f32>Maximum height constraint
Implementations§
Source§impl Container
impl Container
Sourcepub const fn background(self, color: Color) -> Self
pub const fn background(self, color: Color) -> Self
Set the background color.
Sourcepub const fn corner_radius(self, radius: CornerRadius) -> Self
pub const fn corner_radius(self, radius: CornerRadius) -> Self
Set the corner radius.
Sourcepub const fn min_height(self, height: f32) -> Self
pub const fn min_height(self, height: f32) -> Self
Set minimum height.
Sourcepub const fn max_height(self, height: f32) -> Self
pub const fn max_height(self, height: f32) -> Self
Set maximum height.
Sourcepub fn with_test_id(self, id: impl Into<String>) -> Self
pub fn with_test_id(self, id: impl Into<String>) -> Self
Set the test ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Container
impl<'de> Deserialize<'de> for Container
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Widget for Container
impl Widget for Container
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for Container
impl !RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl !UnwindSafe for Container
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more