cosmic::widget

Type Alias Column

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

Aliased Type§

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

Implementations

source§

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

source

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

Creates an empty Column.

source

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

Creates a Column with the given capacity.

source

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

Creates a Column with the given elements.

source

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

Creates a Column from an already allocated Vec.

Keep in mind that the Column 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 Column::width or Column::height accordingly.

source

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

Sets the vertical 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) -> Column<'a, Message, Theme, Renderer>
where P: Into<Padding>,

Sets the Padding of the Column.

source

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

Sets the width of the Column.

source

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

Sets the height of the Column.

source

pub fn max_width( self, max_width: impl Into<Pixels>, ) -> Column<'a, Message, Theme, Renderer>

Sets the maximum width of the Column.

source

pub fn align_x( self, align: impl Into<Horizontal>, ) -> Column<'a, Message, Theme, Renderer>

Sets the horizontal alignment of the contents of the Column .

source

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

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

source

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

Adds an element to the Column.

source

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

Adds an element to the Column, if Some.

source

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

Extends the Column with the given children.

Trait Implementations§

source§

impl<'a, Message: 'a> CollectionWidget<'a, Message> for Column<'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 Column<'a, Message, Renderer>
where Renderer: Renderer,

source§

fn default() -> Column<'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 Column<'a, Message, Theme, Renderer>
where Renderer: Renderer,

source§

fn from_iter<T>(iter: T) -> Column<'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 Column<'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