pub struct Card {
pub background: Color,
pub border_color: Option<Color>,
pub radius: f32,
pub elevation: f32,
pub padding: EdgeInsets,
pub width: Option<f32>,
pub material: Option<ShaderMaterial>,
pub child: BoxedWidget,
}Expand description
An elevated surface — background + rounded corners + optional shadow.
The most common surface for grouping content (task card, profile card, etc.).
Fields§
§background: Color§border_color: Option<Color>§radius: f32§elevation: f32§padding: EdgeInsets§width: Option<f32>§material: Option<ShaderMaterial>§child: BoxedWidgetImplementations§
Source§impl Card
impl Card
pub fn new(child: impl Widget + 'static) -> Self
pub fn background(self, c: Color) -> Self
pub fn border(self, c: Color) -> Self
pub fn no_border(self) -> Self
pub fn radius(self, r: f32) -> Self
pub fn elevation(self, e: f32) -> Self
pub fn padding(self, p: EdgeInsets) -> Self
pub fn width(self, w: f32) -> Self
Sourcepub fn material(self, m: ShaderMaterial) -> Self
pub fn material(self, m: ShaderMaterial) -> Self
Per-instance shader material — replaces the background fill when
resolved. Beats the theme’s CardMaterial default. Corners are drawn
square under the shader (no rounded-clip primitive yet, D124 Step 4+).
Trait Implementations§
Source§impl Widget for Card
impl Widget for Card
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Card
impl !UnwindSafe for Card
impl Freeze for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnsafeUnpin for Card
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
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.