Skip to main content

RowScope

Struct RowScope 

Source
pub struct RowScope { /* private fields */ }
Expand description

A Row and its builder.

Implementations§

Source§

impl RowScope

Source

pub fn arrangement(self, arrangement: Arrangement) -> Self

How the children share the main axis.

Source

pub fn spacing(self, dp: f32) -> Self

A literal gap between children, in dp.

Source

pub fn space_role(self, role: SpaceRole) -> Self

A gap from the design system’s spacing ladder.

Source

pub fn alignment(self, alignment: Alignment) -> Self

Where the children sit on the cross axis.

Source

pub fn intrinsic_size(self, enabled: bool) -> Self

Sizes the cross axis to the tallest child in a Row or the widest child in a Column, so children with fill_max_height or fill_max_width match the largest sibling without an explicit container size.

Source

pub fn radio_group(self, enabled: bool) -> Self

Makes this layout a group of the RadioButtons inside it.

The group is one stop for Tab: the selected button, or the first when none is. The arrow keys move focus to the next or the previous button, wrapping at the ends, and each move sends that button’s on_change(true) once, the same report a click sends. Which button is selected is still the application’s to decide. Assistive technology hears the layout as a radio group.

Source§

impl RowScope

Source

pub fn modifier(self, modifier: Modifier) -> Self

What sits around it. Compose’s modifier parameter.

Source§

impl RowScope

Source

pub fn content(self, content: impl FnOnce())

Composes this widget with content as its children.

Source§

impl RowScope

Source

pub fn on_pointer( self, kinds: PointerKinds, handler: impl FnMut(PointerEvent) + 'static, ) -> Self

Subscribes the node to the kinds of pointer input in kinds. The handler runs on the same call as the input; calling consume on the event keeps it from the nearest subscribed ancestor and from the Renderer’s own handling.

A node that never calls this has no pointer input at all, and costs nothing.

Source§

impl RowScope

Source

pub fn on_click(self, handler: impl FnMut() + 'static) -> Self

Makes the container a button. The Renderer gives it keyboard focus, runs the handler on a click and on Enter or Space, announces it to assistive technology as a button, and shows hover, pressed and focus state.

A container that never calls this is not a control and costs nothing.

Source§

impl RowScope

Source

pub fn on_focus_gained(self, handler: impl FnMut() + 'static) -> Self

Runs when this node or a descendant inside it gains keyboard focus.

Source

pub fn on_focus_lost(self, handler: impl FnMut() + 'static) -> Self

Runs when this node and its descendants lose keyboard focus.

Source

pub fn on_key_down(self, handler: impl FnMut(KeyEvent) + 'static) -> Self

Sees each key pressed while this node or a descendant inside it holds focus; calling consume on the event keeps the Renderer from acting on it.

Source

pub fn on_key_up(self, handler: impl FnMut(KeyEvent) + 'static) -> Self

Sees each key released while this node or a descendant inside it holds focus.

Source

pub fn focus_handle(self, handle: &FocusHandle) -> Self

Binds handle to this node, so handle.request() puts keyboard focus here.

Source

pub fn on_motion_finished( self, handler: impl FnMut(MotionFinished) + 'static, ) -> Self

Runs once when this node’s size motion comes to rest, with the size it settled at in dp. The node needs Modifier::motion for its size to move; without it nothing is reported. A run interrupted by a newer size is not reported, only the one that settles, and under reduced motion it arrives in the frame the size changes in.

Source§

impl RowScope

Source

pub fn tear_off_key(self, key: impl Into<String>) -> Self

Lets the user pull this node out into a window of its own, named by key: the RestoreKey of the window that results.

Source

pub fn on_window_drag_over( self, handler: impl FnMut(WindowDragOver) + 'static, ) -> Self

Hears a dragged window pass over this node: where a tab row shows the place a dropped tab would go.

Source§

impl RowScope

Source

pub fn equal_height(self, enabled: bool) -> Self

Sizes the row to its tallest child so children with fill_max_height match their siblings’ height.

Trait Implementations§

Source§

impl Drop for RowScope

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.