cosmic::widget

Type Alias Row

source
pub type Row<'a, Message> = Row<'a, Message, Theme, Renderer>;

Aliased Type§

struct Row<'a, Message> { /* private fields */ }

Implementations

source§

impl<'a, Message, Theme, Renderer> Row<'a, Message, Theme, Renderer>
where Renderer: Renderer,

source

pub fn new() -> Row<'a, Message, Theme, Renderer>

Creates an empty Row.

source

pub fn with_capacity(capacity: usize) -> Row<'a, Message, Theme, Renderer>

Creates a Row with the given capacity.

source

pub fn with_children( children: impl IntoIterator<Item = Element<'a, Message, Theme, Renderer>>, ) -> Row<'a, Message, Theme, Renderer>

Creates a Row with the given elements.

source

pub fn from_vec( children: Vec<Element<'a, Message, Theme, Renderer>>, ) -> Row<'a, Message, Theme, Renderer>

Creates a Row from an already allocated Vec.

Keep in mind that the Row will not inspect the Vec, which means it won’t automatically adapt to the sizing strategy of its contents.

If any of the children have a Length::Fill strategy, you will need to call Row::width or Row::height accordingly.

source

pub fn spacing( self, amount: impl Into<Pixels>, ) -> Row<'a, Message, Theme, Renderer>

Sets the horizontal spacing between elements.

Custom margins per element do not exist in iced. You should use this method instead! While less flexible, it helps you keep spacing between elements consistent.

source

pub fn padding<P>(self, padding: P) -> Row<'a, Message, Theme, Renderer>
where P: Into<Padding>,

Sets the Padding of the Row.

source

pub fn width( self, width: impl Into<Length>, ) -> Row<'a, Message, Theme, Renderer>

Sets the width of the Row.

source

pub fn height( self, height: impl Into<Length>, ) -> Row<'a, Message, Theme, Renderer>

Sets the height of the Row.

source

pub fn align_y( self, align: impl Into<Vertical>, ) -> Row<'a, Message, Theme, Renderer>

Sets the vertical alignment of the contents of the Row .

source

pub fn clip(self, clip: bool) -> Row<'a, Message, Theme, Renderer>

Sets whether the contents of the Row should be clipped on overflow.

source

pub fn push( self, child: impl Into<Element<'a, Message, Theme, Renderer>>, ) -> Row<'a, Message, Theme, Renderer>

Adds an Element to the Row.

source

pub fn push_maybe( self, child: Option<impl Into<Element<'a, Message, Theme, Renderer>>>, ) -> Row<'a, Message, Theme, Renderer>

Adds an element to the Row, if Some.

source

pub fn extend( self, children: impl IntoIterator<Item = Element<'a, Message, Theme, Renderer>>, ) -> Row<'a, Message, Theme, Renderer>

Extends the Row with the given children.

source

pub fn wrap(self) -> Wrapping<'a, Message, Theme, Renderer>

Turns the Row into a [Wrapping] row.

The original alignment of the Row is preserved per row wrapped.

Trait Implementations§

source§

impl<'a, Message: 'a> CollectionWidget<'a, Message> for Row<'a, Message>

source§

fn append<E>(self, other: &mut Vec<E>) -> Self
where E: Into<Element<'a, Message>>,

Moves all the elements of other into self, leaving other empty.
source§

fn push(self, element: impl Into<Element<'a, Message>>) -> Self

Pushes an element into the widget.
source§

fn extend<E>(self, iterator: impl Iterator<Item = E>) -> Self
where E: Into<Element<'a, Message>>,

Appends all elements in an iterator to the widget.
source§

fn push_maybe(self, element: Option<impl Into<Element<'a, Message>>>) -> Self

Conditionally pushes an element to the widget.
source§

impl<'a, Message, Renderer> Default for Row<'a, Message, Renderer>
where Renderer: Renderer,

source§

fn default() -> Row<'a, Message, Renderer>

Returns the “default value” for a type. Read more
source§

impl<'a, Message, Theme, Renderer> FromIterator<Element<'a, Message, Theme, Renderer>> for Row<'a, Message, Theme, Renderer>
where Renderer: Renderer,

source§

fn from_iter<T>(iter: T) -> Row<'a, Message, Theme, Renderer>
where T: IntoIterator<Item = Element<'a, Message, Theme, Renderer>>,

Creates a value from an iterator. Read more
source§

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Row<'a, Message, Theme, Renderer>
where Renderer: Renderer,

source§

fn a11y_nodes( &self, layout: Layout<'_>, state: &Tree, cursor: Cursor, ) -> A11yTree

get the a11y nodes for the widget

source§

fn children(&self) -> Vec<Tree>

Returns the state Tree of the children of the Widget.
source§

fn diff(&mut self, tree: &mut Tree)

Reconciliates the Widget with the provided Tree.
source§

fn size(&self) -> Size<Length>

Returns the Size of the Widget in lengths.
source§

fn layout(&self, tree: &mut Tree, renderer: &Renderer, limits: &Limits) -> Node

Returns the layout::Node of the Widget. Read more
source§

fn operate( &self, tree: &mut Tree, layout: Layout<'_>, renderer: &Renderer, operation: &mut dyn Operation, )

Applies an Operation to the Widget.
source§

fn on_event( &mut self, tree: &mut Tree, event: Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) -> Status

Processes a runtime Event. Read more
source§

fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, renderer: &Renderer, ) -> Interaction

Returns the current mouse::Interaction of the Widget. Read more
source§

fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, )

Draws the Widget using the associated Renderer.
source§

fn overlay<'b>( &'b mut self, tree: &'b mut Tree, layout: Layout<'_>, renderer: &Renderer, translation: Vector, ) -> Option<Element<'b, Message, Theme, Renderer>>

Returns the overlay of the Widget, if there is any.
source§

fn drag_destinations( &self, state: &Tree, layout: Layout<'_>, renderer: &Renderer, dnd_rectangles: &mut DndDestinationRectangles, )

Adds the drag destination rectangles of the widget. Runs after the layout phase for each widget in the tree.
source§

fn size_hint(&self) -> Size<Length>

Returns a Size hint for laying out the Widget. Read more
source§

fn tag(&self) -> Tag

Returns the Tag of the Widget.
source§

fn state(&self) -> State

Returns the State of the Widget.
source§

fn id(&self) -> Option<Id>

Returns the id of the widget
source§

fn set_id(&mut self, _id: Id)

Sets the id of the widget This may be called while diffing the widget tree