BuiltinStyle

Struct BuiltinStyle 

Source
pub struct BuiltinStyle<'a> { /* private fields */ }

Implementations§

Source§

impl BuiltinStyle<'_>

Source

pub fn display(&self) -> Display

Controls the display type of the view.

This determines how the view participates in layout.

Source

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.

Source

pub fn width(&self) -> PxPctAuto

Sets the width of the view.

Can be specified in pixels, percentages, or auto.

Source

pub fn height(&self) -> PxPctAuto

Sets the height of the view.

Can be specified in pixels, percentages, or auto.

Source

pub fn min_width(&self) -> PxPctAuto

Sets the minimum width of the view.

The view will not shrink below this width.

Source

pub fn min_height(&self) -> PxPctAuto

Sets the minimum height of the view.

The view will not shrink below this height.

Source

pub fn max_width(&self) -> PxPctAuto

Sets the maximum width of the view.

The view will not grow beyond this width.

Source

pub fn max_height(&self) -> PxPctAuto

Sets the maximum height of the view.

The view will not grow beyond this height.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn grid_row(&self) -> Line<GridPlacement>

Specifies a grid item’s location within the grid row.

Determines which grid rows the item spans.

Source

pub fn grid_column(&self) -> Line<GridPlacement>

Specifies a grid item’s location within the grid column.

Determines which grid columns the item spans.

Source

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.

Source

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.

Source

pub fn outline(&self) -> StrokeWrap

Sets the outline stroke properties.

Defines the width, style, and other properties of the outline.

Source

pub fn outline_progress(&self) -> Pct

Controls the progress/completion of the outline animation.

Useful for creating animated outline effects.

Source

pub fn border_progress(&self) -> Pct

Controls the progress/completion of the border animation.

Useful for creating animated border effects.

Source

pub fn border_combined(&self) -> Border

Sets the border properties for all sides.

Defines width, style, and other border characteristics.

Source

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.

Source

pub fn border_radius_combined(&self) -> BorderRadius

Sets the border radius for all corners.

Controls how rounded the corners of the view are.

Source

pub fn padding_combined(&self) -> Padding

Sets the padding for all sides.

Padding is the space between the view’s content and its border.

Source

pub fn margin_combined(&self) -> Margin

Sets the margin for all sides.

Margin is the space outside the view’s border.

Source

pub fn inset_left(&self) -> PxPctAuto

Sets the left offset for positioned views.

Source

pub fn inset_top(&self) -> PxPctAuto

Sets the top offset for positioned views.

Source

pub fn inset_right(&self) -> PxPctAuto

Sets the right offset for positioned views.

Source

pub fn inset_bottom(&self) -> PxPctAuto

Sets the bottom offset for positioned views.

Source

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.

Source

pub fn z_index(&self) -> Option<i32>

Controls the stack order of positioned views.

Higher values appear in front of lower values.

Source

pub fn cursor(&self) -> Option<CursorStyle>

Sets the cursor style when hovering over the view.

Changes the appearance of the mouse cursor.

Source

pub fn color(&self) -> Option<Color>

Sets the text color.

This property is inherited by child views.

Source

pub fn background(&self) -> Option<Brush>

Sets the background color or image.

Can be a solid color, gradient, or image.

Source

pub fn foreground(&self) -> Option<Brush>

Sets the foreground color or pattern.

Used for drawing content like icons or shapes.

Source

pub fn box_shadow(&self) -> SmallVec<[BoxShadow; 3]>

Adds one or more drop shadows to the view.

Can create depth and visual separation effects.

Source

pub fn font_size(&self) -> Option<f32>

Sets the font size for text content.

This property is inherited by child views.

Source

pub fn font_family(&self) -> Option<String>

Sets the font family for text content.

This property is inherited by child views.

Source

pub fn font_weight(&self) -> Option<Weight>

Sets the font weight (boldness) for text content.

This property is inherited by child views.

Source

pub fn font_style(&self) -> Option<Style>

Sets the font style (italic, normal) for text content.

This property is inherited by child views.

Source

pub fn cursor_color(&self) -> Brush

Sets the color of the text cursor.

Visible when text input views have focus.

Source

pub fn selection_corer_radius(&self) -> f64

Sets the corner radius of text selections.

Controls how rounded the corners of selected text appear.

Source

pub fn selectable(&self) -> bool

Controls whether the view’s text can be selected.

This property is inherited by child views.

Source

pub fn text_overflow(&self) -> TextOverflow

Controls how overflowed text content is handled.

Determines whether text wraps or gets clipped.

Source

pub fn text_align(&self) -> Option<Align>

Sets text alignment within the view.

Controls horizontal alignment of text content.

Source

pub fn line_height(&self) -> Option<LineHeightValue>

Sets the line height for text content.

This property is inherited by child views.

Source

pub fn aspect_ratio(&self) -> Option<f32>

Sets the preferred aspect ratio for the view.

Maintains width-to-height proportions during layout.

Source

pub fn col_gap(&self) -> PxPct

Sets the gap between columns in grid or flex layouts.

Creates space between items in the horizontal direction.

Source

pub fn row_gap(&self) -> PxPct

Sets the gap between rows in grid or flex layouts.

Creates space between items in the vertical direction.

Source

pub fn scale_x(&self) -> Pct

Sets the horizontal scale transform.

Values less than 100% shrink the view, greater than 100% enlarge it.

Source

pub fn scale_y(&self) -> Pct

Sets the vertical scale transform.

Values less than 100% shrink the view, greater than 100% enlarge it.

Source

pub fn translate_x(&self) -> PxPct

Sets the horizontal translation transform.

Moves the view left (negative) or right (positive).

Source

pub fn translate_y(&self) -> PxPct

Sets the vertical translation transform.

Moves the view up (negative) or down (positive).

Source

pub fn rotate(&self) -> Px

Sets the rotation transform in radians.

Positive values rotate clockwise, negative values rotate counter-clockwise.

Source

pub fn set_selected(&self) -> bool

Controls the selected state of the view.

This property is inherited by child views.

Source

pub fn set_disabled(&self) -> bool

Controls the disabled state of the view.

This property is inherited by child views.

Source

pub fn set_hidden(&self) -> bool

Controls the visibility of the view.

This property is inherited by child views.

Source

pub fn focusable(&self) -> bool

Controls whether the view can receive focus.

Focus is necessary for keyboard interaction.

Source

pub fn draggable(&self) -> bool

Controls whether the view can be dragged.

Enables drag-and-drop functionality for the view.

Source§

impl BuiltinStyle<'_>

Source

pub fn padding_left(&self) -> PxPct

Source

pub fn padding_top(&self) -> PxPct

Source

pub fn padding_right(&self) -> PxPct

Source

pub fn padding_bottom(&self) -> PxPct

Source

pub fn margin_left(&self) -> PxPctAuto

Source

pub fn margin_top(&self) -> PxPctAuto

Source

pub fn margin_right(&self) -> PxPctAuto

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more