pub struct ColumnScope { /* private fields */ }Expand description
A Column and its builder.
Implementations§
Source§impl ColumnScope
impl ColumnScope
Sourcepub fn arrangement(self, arrangement: Arrangement) -> Self
pub fn arrangement(self, arrangement: Arrangement) -> Self
How the children share the main axis.
Sourcepub fn space_role(self, role: SpaceRole) -> Self
pub fn space_role(self, role: SpaceRole) -> Self
A gap from the design system’s spacing ladder.
Sourcepub fn intrinsic_size(self, enabled: bool) -> Self
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.
Sourcepub fn radio_group(self, enabled: bool) -> Self
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 ColumnScope
impl ColumnScope
Source§impl ColumnScope
impl ColumnScope
Source§impl ColumnScope
impl ColumnScope
Sourcepub fn on_pointer(
self,
kinds: PointerKinds,
handler: impl FnMut(PointerEvent) + 'static,
) -> Self
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 ColumnScope
impl ColumnScope
Sourcepub fn on_click(self, handler: impl FnMut() + 'static) -> Self
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 ColumnScope
impl ColumnScope
Sourcepub fn on_focus_gained(self, handler: impl FnMut() + 'static) -> Self
pub fn on_focus_gained(self, handler: impl FnMut() + 'static) -> Self
Runs when this node or a descendant inside it gains keyboard focus.
Sourcepub fn on_focus_lost(self, handler: impl FnMut() + 'static) -> Self
pub fn on_focus_lost(self, handler: impl FnMut() + 'static) -> Self
Runs when this node and its descendants lose keyboard focus.
Sourcepub fn on_key_down(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
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.
Sourcepub fn on_key_up(self, handler: impl FnMut(KeyEvent) + 'static) -> Self
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.
Sourcepub fn focus_handle(self, handle: &FocusHandle) -> Self
pub fn focus_handle(self, handle: &FocusHandle) -> Self
Binds handle to this node, so handle.request() puts keyboard focus here.
Sourcepub fn on_motion_finished(
self,
handler: impl FnMut(MotionFinished) + 'static,
) -> Self
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 ColumnScope
impl ColumnScope
Sourcepub fn tear_off_key(self, key: impl Into<String>) -> Self
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.
Sourcepub fn on_window_drag_over(
self,
handler: impl FnMut(WindowDragOver) + 'static,
) -> Self
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 ColumnScope
impl ColumnScope
Sourcepub fn equal_width(self, enabled: bool) -> Self
pub fn equal_width(self, enabled: bool) -> Self
Sizes the column to its widest child so children with fill_max_width match their
siblings’ width.