Skip to main content

ModifierExt

Trait ModifierExt 

Source
pub trait ModifierExt {
Show 29 methods // Required methods fn window_insets_padding(self, insets: WindowInsets) -> Modifier; fn consume_window_insets(self, insets: WindowInsets) -> Modifier; fn window_insets_left_width(self, insets: WindowInsets) -> Modifier; fn window_insets_top_height(self, insets: WindowInsets) -> Modifier; fn window_insets_right_width(self, insets: WindowInsets) -> Modifier; fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier; fn padding(self, padding: Padding) -> Modifier; fn padding_all(self, padding: Dp) -> Modifier; fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier; fn offset(self, x: Dp, y: Dp) -> Modifier; fn size(self, width: Dp, height: Dp) -> Modifier; fn required_size(self, width: Dp, height: Dp) -> Modifier; fn required_width(self, width: Dp) -> Modifier; fn required_height(self, height: Dp) -> Modifier; fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier; fn width(self, width: Dp) -> Modifier; fn height(self, height: Dp) -> Modifier; fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier; fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier; fn fill_max_width(self) -> Modifier; fn fill_max_height(self) -> Modifier; fn fill_max_size(self) -> Modifier; fn minimum_interactive_component_size(self) -> Modifier; fn weight(self, weight: f32) -> Modifier; fn align(self, alignment: Alignment) -> Modifier; fn draggable<C>(self, on_drag_delta: C) -> Modifier where C: Into<CallbackWith<DragDelta, ()>>; fn draggable_with(self, args: DraggableArgs) -> Modifier; fn semantics(self, args: SemanticsArgs) -> Modifier; fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier;
}
Expand description

Shared modifier extensions that are not tied to a specific design system.

Required Methods§

Source

fn window_insets_padding(self, insets: WindowInsets) -> Modifier

Pads and consumes the space not already occupied by enclosing inset modifiers.

Source

fn consume_window_insets(self, insets: WindowInsets) -> Modifier

Marks inset space as occupied for nested padding and size modifiers.

Source

fn window_insets_left_width(self, insets: WindowInsets) -> Modifier

Sets width to the remaining left window inset.

Source

fn window_insets_top_height(self, insets: WindowInsets) -> Modifier

Sets height to the remaining top window inset.

Source

fn window_insets_right_width(self, insets: WindowInsets) -> Modifier

Sets width to the remaining right window inset.

Source

fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier

Sets height to the remaining bottom window inset.

Source

fn padding(self, padding: Padding) -> Modifier

Adds padding around the content.

Source

fn padding_all(self, padding: Dp) -> Modifier

Adds symmetric padding on all edges.

Source

fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier

Adds symmetric padding for horizontal and vertical edges.

Source

fn offset(self, x: Dp, y: Dp) -> Modifier

Offsets the content without affecting layout size.

Source

fn size(self, width: Dp, height: Dp) -> Modifier

Constrains the content to an exact size when possible.

Source

fn required_size(self, width: Dp, height: Dp) -> Modifier

Pins the content to an exact size regardless of incoming constraints.

Source

fn required_width(self, width: Dp) -> Modifier

Pins the content width regardless of incoming constraints.

Source

fn required_height(self, height: Dp) -> Modifier

Pins the content height regardless of incoming constraints.

Source

fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier

Applies a default minimum size only when the incoming axis leaves the minimum open, so an explicit outer size always wins.

Source

fn width(self, width: Dp) -> Modifier

Constrains the content to an exact width when possible.

Source

fn height(self, height: Dp) -> Modifier

Constrains the content to an exact height when possible.

Source

fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier

Constrains the content size within optional min/max bounds.

Source

fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier

Applies explicit width/height interval constraints.

Source

fn fill_max_width(self) -> Modifier

Fills the available width within parent bounds.

Source

fn fill_max_height(self) -> Modifier

Fills the available height within parent bounds.

Source

fn fill_max_size(self) -> Modifier

Fills the available size within parent bounds.

Source

fn minimum_interactive_component_size(self) -> Modifier

Enforces a minimum interactive size by expanding and centering content.

Source

fn weight(self, weight: f32) -> Modifier

Provides weighted parent data for row and column layouts.

Source

fn align(self, alignment: Alignment) -> Modifier

Provides alignment parent data for layered boxed layouts.

Source

fn draggable<C>(self, on_drag_delta: C) -> Modifier
where C: Into<CallbackWith<DragDelta, ()>>,

Emits drag deltas for free-form dragging.

Source

fn draggable_with(self, args: DraggableArgs) -> Modifier

Emits drag deltas with custom drag configuration.

Source

fn semantics(self, args: SemanticsArgs) -> Modifier

Attaches accessibility semantics metadata to this subtree.

Source

fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier

Clears descendant semantics and applies the provided metadata.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ModifierExt for Modifier

Source§

fn window_insets_padding(self, insets: WindowInsets) -> Modifier

Source§

fn consume_window_insets(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_left_width(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_top_height(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_right_width(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier

Source§

fn padding(self, padding: Padding) -> Modifier

Source§

fn padding_all(self, padding: Dp) -> Modifier

Source§

fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier

Source§

fn offset(self, x: Dp, y: Dp) -> Modifier

Source§

fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier

Source§

fn size(self, width: Dp, height: Dp) -> Modifier

Source§

fn required_size(self, width: Dp, height: Dp) -> Modifier

Source§

fn required_width(self, width: Dp) -> Modifier

Source§

fn required_height(self, height: Dp) -> Modifier

Source§

fn width(self, width: Dp) -> Modifier

Source§

fn height(self, height: Dp) -> Modifier

Source§

fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier

Source§

fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier

Source§

fn fill_max_width(self) -> Modifier

Source§

fn fill_max_height(self) -> Modifier

Source§

fn fill_max_size(self) -> Modifier

Source§

fn minimum_interactive_component_size(self) -> Modifier

Source§

fn weight(self, weight: f32) -> Modifier

Source§

fn align(self, alignment: Alignment) -> Modifier

Source§

fn draggable<C>(self, on_drag_delta: C) -> Modifier
where C: Into<CallbackWith<DragDelta, ()>>,

Source§

fn draggable_with(self, args: DraggableArgs) -> Modifier

Source§

fn semantics(self, args: SemanticsArgs) -> Modifier

Source§

fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier

Implementors§