pub struct BuiltinStyle<'a> { /* private fields */ }Implementations§
Source§impl BuiltinStyle<'_>
impl BuiltinStyle<'_>
Sourcepub fn display(&self) -> Display
pub fn display(&self) -> Display
Controls the display type of the view.
This determines how the view participates in layout.
Sourcepub fn position(&self) -> Position
pub fn position(&self) -> Position
Sets the positioning scheme for the view.
This affects how the view is positioned relative to its normal position in the document flow.
Sourcepub fn width(&self) -> PxPctAuto
pub fn width(&self) -> PxPctAuto
Sets the width of the view.
Can be specified in pixels, percentages, or auto.
Sourcepub fn height(&self) -> PxPctAuto
pub fn height(&self) -> PxPctAuto
Sets the height of the view.
Can be specified in pixels, percentages, or auto.
Sourcepub fn min_width(&self) -> PxPctAuto
pub fn min_width(&self) -> PxPctAuto
Sets the minimum width of the view.
The view will not shrink below this width.
Sourcepub fn min_height(&self) -> PxPctAuto
pub fn min_height(&self) -> PxPctAuto
Sets the minimum height of the view.
The view will not shrink below this height.
Sourcepub fn max_width(&self) -> PxPctAuto
pub fn max_width(&self) -> PxPctAuto
Sets the maximum width of the view.
The view will not grow beyond this width.
Sourcepub fn max_height(&self) -> PxPctAuto
pub fn max_height(&self) -> PxPctAuto
Sets the maximum height of the view.
The view will not grow beyond this height.
Sourcepub fn flex_direction(&self) -> FlexDirection
pub fn flex_direction(&self) -> FlexDirection
Sets the direction of the main axis for flex items.
Determines whether flex items are laid out in rows or columns.
Sourcepub fn flex_wrap(&self) -> FlexWrap
pub fn flex_wrap(&self) -> FlexWrap
Controls whether flex items wrap to new lines.
When enabled, items that don’t fit will wrap to the next line.
Sourcepub fn flex_grow(&self) -> f32
pub fn flex_grow(&self) -> f32
Sets the flex grow factor for the flex item.
Determines how much the item should grow relative to other items.
Sourcepub fn flex_shrink(&self) -> f32
pub fn flex_shrink(&self) -> f32
Sets the flex shrink factor for the flex item.
Determines how much the item should shrink relative to other items.
Sourcepub fn flex_basis(&self) -> PxPctAuto
pub fn flex_basis(&self) -> PxPctAuto
Sets the initial main size of a flex item.
This is the size of the item before free space is distributed.
Sourcepub fn justify_content(&self) -> Option<JustifyContent>
pub fn justify_content(&self) -> Option<JustifyContent>
Controls alignment of flex items along the main axis.
Determines how extra space is distributed between and around items.
Sourcepub fn justify_items(&self) -> Option<JustifyItems>
pub fn justify_items(&self) -> Option<JustifyItems>
Controls default alignment of grid items along the inline axis.
Sets the default justify-self value for all items in the container.
Sourcepub fn box_sizing(&self) -> Option<BoxSizing>
pub fn box_sizing(&self) -> Option<BoxSizing>
Controls how the total width and height are calculated.
Determines whether borders and padding are included in the view’s size.
Sourcepub fn justify_self(&self) -> Option<AlignItems>
pub fn justify_self(&self) -> Option<AlignItems>
Controls individual alignment along the inline axis.
Overrides the container’s justify-items value for this specific item.
Sourcepub fn align_items(&self) -> Option<AlignItems>
pub fn align_items(&self) -> Option<AlignItems>
Controls alignment of flex items along the cross axis.
Determines how items are aligned when they don’t fill the container’s cross axis.
Sourcepub fn align_content(&self) -> Option<AlignContent>
pub fn align_content(&self) -> Option<AlignContent>
Controls alignment of wrapped flex lines.
Only has an effect when flex-wrap is enabled and there are multiple lines.
Sourcepub fn grid_template_rows(&self) -> Vec<GridTemplateComponent<String>>
pub fn grid_template_rows(&self) -> Vec<GridTemplateComponent<String>>
Defines the line names and track sizing functions of the grid rows.
Specifies the size and names of the rows in a grid layout.
Sourcepub fn grid_template_columns(&self) -> Vec<GridTemplateComponent<String>>
pub fn grid_template_columns(&self) -> Vec<GridTemplateComponent<String>>
Defines the line names and track sizing functions of the grid columns.
Specifies the size and names of the columns in a grid layout.
Sourcepub fn grid_auto_rows(
&self,
) -> Vec<MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>>
pub fn grid_auto_rows( &self, ) -> Vec<MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>>
Specifies the size of implicitly-created grid rows.
Sets the default size for rows that are created automatically.
Sourcepub fn grid_auto_columns(
&self,
) -> Vec<MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>>
pub fn grid_auto_columns( &self, ) -> Vec<MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>>
Specifies the size of implicitly-created grid columns.
Sets the default size for columns that are created automatically.
Sourcepub fn grid_auto_flow(&self) -> GridAutoFlow
pub fn grid_auto_flow(&self) -> GridAutoFlow
Controls how auto-placed items get flowed into the grid.
Determines the direction that grid items are placed when not explicitly positioned.
Sourcepub fn grid_row(&self) -> Line<GridPlacement>
pub fn grid_row(&self) -> Line<GridPlacement>
Specifies a grid item’s location within the grid row.
Determines which grid rows the item spans.
Sourcepub fn grid_column(&self) -> Line<GridPlacement>
pub fn grid_column(&self) -> Line<GridPlacement>
Specifies a grid item’s location within the grid column.
Determines which grid columns the item spans.
Sourcepub fn align_self(&self) -> Option<AlignItems>
pub fn align_self(&self) -> Option<AlignItems>
Controls individual alignment along the cross axis.
Overrides the container’s align-items value for this specific item.
Sourcepub fn outline_color(&self) -> Brush
pub fn outline_color(&self) -> Brush
Sets the color of the view’s outline.
The outline is drawn outside the border and doesn’t affect layout.
Sourcepub fn outline(&self) -> StrokeWrap
pub fn outline(&self) -> StrokeWrap
Sets the outline stroke properties.
Defines the width, style, and other properties of the outline.
Sourcepub fn outline_progress(&self) -> Pct
pub fn outline_progress(&self) -> Pct
Controls the progress/completion of the outline animation.
Useful for creating animated outline effects.
Sourcepub fn border_progress(&self) -> Pct
pub fn border_progress(&self) -> Pct
Controls the progress/completion of the border animation.
Useful for creating animated border effects.
Sourcepub fn border_combined(&self) -> Border
pub fn border_combined(&self) -> Border
Sets the border properties for all sides.
Defines width, style, and other border characteristics.
Sourcepub fn border_color_combined(&self) -> BorderColor
pub fn border_color_combined(&self) -> BorderColor
Sets the border color for all sides.
Can be set individually for each side or all at once.
Sourcepub fn border_radius_combined(&self) -> BorderRadius
pub fn border_radius_combined(&self) -> BorderRadius
Sets the border radius for all corners.
Controls how rounded the corners of the view are.
Sourcepub fn padding_combined(&self) -> Padding
pub fn padding_combined(&self) -> Padding
Sets the padding for all sides.
Padding is the space between the view’s content and its border.
Sourcepub fn margin_combined(&self) -> Margin
pub fn margin_combined(&self) -> Margin
Sets the margin for all sides.
Margin is the space outside the view’s border.
Sourcepub fn inset_left(&self) -> PxPctAuto
pub fn inset_left(&self) -> PxPctAuto
Sets the left offset for positioned views.
Sourcepub fn inset_right(&self) -> PxPctAuto
pub fn inset_right(&self) -> PxPctAuto
Sets the right offset for positioned views.
Sourcepub fn inset_bottom(&self) -> PxPctAuto
pub fn inset_bottom(&self) -> PxPctAuto
Sets the bottom offset for positioned views.
Sourcepub fn pointer_events(&self) -> Option<PointerEvents>
pub fn pointer_events(&self) -> Option<PointerEvents>
Controls whether the view can be the target of mouse events.
When disabled, mouse events pass through to views behind.
Sourcepub fn z_index(&self) -> Option<i32>
pub fn z_index(&self) -> Option<i32>
Controls the stack order of positioned views.
Higher values appear in front of lower values.
Sourcepub fn cursor(&self) -> Option<CursorStyle>
pub fn cursor(&self) -> Option<CursorStyle>
Sets the cursor style when hovering over the view.
Changes the appearance of the mouse cursor.
Sourcepub fn color(&self) -> Option<Color>
pub fn color(&self) -> Option<Color>
Sets the text color.
This property is inherited by child views.
Sourcepub fn background(&self) -> Option<Brush>
pub fn background(&self) -> Option<Brush>
Sets the background color or image.
Can be a solid color, gradient, or image.
Sourcepub fn foreground(&self) -> Option<Brush>
pub fn foreground(&self) -> Option<Brush>
Sets the foreground color or pattern.
Used for drawing content like icons or shapes.
Sourcepub fn box_shadow(&self) -> SmallVec<[BoxShadow; 3]>
pub fn box_shadow(&self) -> SmallVec<[BoxShadow; 3]>
Adds one or more drop shadows to the view.
Can create depth and visual separation effects.
Sourcepub fn font_size(&self) -> Option<f32>
pub fn font_size(&self) -> Option<f32>
Sets the font size for text content.
This property is inherited by child views.
Sourcepub fn font_family(&self) -> Option<String>
pub fn font_family(&self) -> Option<String>
Sets the font family for text content.
This property is inherited by child views.
Sourcepub fn font_weight(&self) -> Option<Weight>
pub fn font_weight(&self) -> Option<Weight>
Sets the font weight (boldness) for text content.
This property is inherited by child views.
Sourcepub fn font_style(&self) -> Option<Style>
pub fn font_style(&self) -> Option<Style>
Sets the font style (italic, normal) for text content.
This property is inherited by child views.
Sourcepub fn cursor_color(&self) -> Brush
pub fn cursor_color(&self) -> Brush
Sets the color of the text cursor.
Visible when text input views have focus.
Sourcepub fn selection_corer_radius(&self) -> f64
pub fn selection_corer_radius(&self) -> f64
Sets the corner radius of text selections.
Controls how rounded the corners of selected text appear.
Sourcepub fn selectable(&self) -> bool
pub fn selectable(&self) -> bool
Controls whether the view’s text can be selected.
This property is inherited by child views.
Sourcepub fn text_overflow(&self) -> TextOverflow
pub fn text_overflow(&self) -> TextOverflow
Controls how overflowed text content is handled.
Determines whether text wraps or gets clipped.
Sourcepub fn text_align(&self) -> Option<Align>
pub fn text_align(&self) -> Option<Align>
Sets text alignment within the view.
Controls horizontal alignment of text content.
Sourcepub fn line_height(&self) -> Option<LineHeightValue>
pub fn line_height(&self) -> Option<LineHeightValue>
Sets the line height for text content.
This property is inherited by child views.
Sourcepub fn aspect_ratio(&self) -> Option<f32>
pub fn aspect_ratio(&self) -> Option<f32>
Sets the preferred aspect ratio for the view.
Maintains width-to-height proportions during layout.
Sourcepub fn col_gap(&self) -> PxPct
pub fn col_gap(&self) -> PxPct
Sets the gap between columns in grid or flex layouts.
Creates space between items in the horizontal direction.
Sourcepub fn row_gap(&self) -> PxPct
pub fn row_gap(&self) -> PxPct
Sets the gap between rows in grid or flex layouts.
Creates space between items in the vertical direction.
Sourcepub fn scale_x(&self) -> Pct
pub fn scale_x(&self) -> Pct
Sets the horizontal scale transform.
Values less than 100% shrink the view, greater than 100% enlarge it.
Sourcepub fn scale_y(&self) -> Pct
pub fn scale_y(&self) -> Pct
Sets the vertical scale transform.
Values less than 100% shrink the view, greater than 100% enlarge it.
Sourcepub fn translate_x(&self) -> PxPct
pub fn translate_x(&self) -> PxPct
Sets the horizontal translation transform.
Moves the view left (negative) or right (positive).
Sourcepub fn translate_y(&self) -> PxPct
pub fn translate_y(&self) -> PxPct
Sets the vertical translation transform.
Moves the view up (negative) or down (positive).
Sourcepub fn rotate(&self) -> Px
pub fn rotate(&self) -> Px
Sets the rotation transform in radians.
Positive values rotate clockwise, negative values rotate counter-clockwise.
Sourcepub fn set_selected(&self) -> bool
pub fn set_selected(&self) -> bool
Controls the selected state of the view.
This property is inherited by child views.
Sourcepub fn set_disabled(&self) -> bool
pub fn set_disabled(&self) -> bool
Controls the disabled state of the view.
This property is inherited by child views.
Controls the visibility of the view.
This property is inherited by child views.
Source§impl BuiltinStyle<'_>
impl BuiltinStyle<'_>
pub fn padding_left(&self) -> PxPct
pub fn padding_top(&self) -> PxPct
pub fn padding_right(&self) -> PxPct
pub fn padding_bottom(&self) -> PxPct
pub fn margin_left(&self) -> PxPctAuto
pub fn margin_top(&self) -> PxPctAuto
pub fn margin_right(&self) -> PxPctAuto
pub fn margin_bottom(&self) -> PxPctAuto
Auto Trait Implementations§
impl<'a> Freeze for BuiltinStyle<'a>
impl<'a> !RefUnwindSafe for BuiltinStyle<'a>
impl<'a> !Send for BuiltinStyle<'a>
impl<'a> !Sync for BuiltinStyle<'a>
impl<'a> Unpin for BuiltinStyle<'a>
impl<'a> !UnwindSafe for BuiltinStyle<'a>
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> 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