Skip to main content

Group

Struct Group 

Source
pub struct Group<'a, Id, Message, Theme = Theme, Renderer = Renderer>
where Id: Clone + Eq, Theme: Catalog + Catalog, Renderer: Renderer + Renderer,
{ /* private fields */ }
Available on crate feature ribbon only.
Expand description

A labeled section within a Ribbon that clusters related widgets. It is resized by the Ribbon depending on what the content function given to the constructor chooses to provide.

§Panics

Panics if the content function does not produce at least one element. Panics if the elements produced by the content function are not sorted in size.

Implementations§

Source§

impl<'a, Id, Message, Theme, Renderer> Group<'a, Id, Message, Theme, Renderer>
where Id: Clone + Eq, Message: 'a + Clone, Theme: 'a + Catalog + Catalog + Catalog, <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>, Renderer: 'a + Renderer + Renderer + Renderer, <Renderer as Renderer>::Font: From<Font>, <Renderer as Renderer>::Paragraph: Clone,

Source

pub fn new( id: Id, header: impl IntoFragment<'a>, content: impl Fn(Size) -> Option<Element<'a, Message, Theme, Renderer>> + 'a, ) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Creates a new Group with the provided header and content function.

Source

pub fn header_size(self, size: impl Into<Pixels>) -> Self

Sets the size of the Group header.

Source

pub fn header_line_height(self, line_height: impl Into<LineHeight>) -> Self

Sets the line height of the Group header.

Source

pub fn header_font(self, font: impl Into<Renderer::Font>) -> Self

Sets the font of the Group header.

Source

pub fn header_wrapping(self, wrapping: Wrapping) -> Self

Sets the Wrapping of the Group header.

Source

pub fn on_launcher_press(self, on_press: Message) -> Self

Sets the message that will be sent when the launcher button is pressed.

Source

pub fn on_collapsed_press(self, on_press: Message) -> Self

Sets the message that will be sent when the Size::Collapsed button is pressed

Source

pub fn on_collapsed_press_with( self, on_press: impl Fn() -> Message + 'a, ) -> Self

Sets the message that will be sent when the Size::Collapsed button is pressed

This is analogous to Group::on_collapsed_press, but using a closure to produce the message.

Source

pub fn header_style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Group header.

Source

pub fn launcher_style( self, style: impl Fn(&Theme, Status) -> Style + 'a, ) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Group launcher button.

Source

pub fn collapsed_style( self, style: impl Fn(&Theme, Status) -> Style + 'a, ) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Group Size::Collapsed button.

Auto Trait Implementations§

§

impl<'a, Id, Message, Theme = Theme, Renderer = ()> !RefUnwindSafe for Group<'a, Id, Message, Theme, Renderer>

§

impl<'a, Id, Message, Theme = Theme, Renderer = ()> !Send for Group<'a, Id, Message, Theme, Renderer>

§

impl<'a, Id, Message, Theme = Theme, Renderer = ()> !Sync for Group<'a, Id, Message, Theme, Renderer>

§

impl<'a, Id, Message, Theme = Theme, Renderer = ()> !UnwindSafe for Group<'a, Id, Message, Theme, Renderer>

§

impl<'a, Id, Message, Theme, Renderer> Freeze for Group<'a, Id, Message, Theme, Renderer>
where Id: Freeze, <Theme as Catalog>::Class<'a>: Freeze, <Theme as Catalog>::Class<'a>: Freeze, <Renderer as Renderer>::Font: Freeze, Message: Freeze,

§

impl<'a, Id, Message, Theme, Renderer> Unpin for Group<'a, Id, Message, Theme, Renderer>
where Id: Unpin, <Theme as Catalog>::Class<'a>: Unpin, <Theme as Catalog>::Class<'a>: Unpin, <Renderer as Renderer>::Font: Unpin, Message: Unpin,

§

impl<'a, Id, Message, Theme, Renderer> UnsafeUnpin for Group<'a, Id, Message, Theme, Renderer>
where Id: UnsafeUnpin, <Theme as Catalog>::Class<'a>: UnsafeUnpin, <Theme as Catalog>::Class<'a>: UnsafeUnpin, <Renderer as Renderer>::Font: UnsafeUnpin, Message: UnsafeUnpin,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.