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§

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§

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.