pub struct Group<'a, Id, Message, Theme = Theme, Renderer = Renderer>{ /* private fields */ }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>
impl<'a, Id, Message, Theme, Renderer> Group<'a, Id, Message, Theme, Renderer>
Sourcepub fn new(
id: Id,
header: impl IntoFragment<'a>,
content: impl Fn(Size) -> Option<Element<'a, Message, Theme, Renderer>> + 'a,
) -> Self
pub fn new( id: Id, header: impl IntoFragment<'a>, content: impl Fn(Size) -> Option<Element<'a, Message, Theme, Renderer>> + 'a, ) -> Self
Creates a new Group with the provided header and content function.
Sourcepub fn header_size(self, size: impl Into<Pixels>) -> Self
pub fn header_size(self, size: impl Into<Pixels>) -> Self
Sets the size of the Group header.
Sourcepub fn header_line_height(self, line_height: impl Into<LineHeight>) -> Self
pub fn header_line_height(self, line_height: impl Into<LineHeight>) -> Self
Sets the line height of the Group header.
Sourcepub fn header_font(self, font: impl Into<Renderer::Font>) -> Self
pub fn header_font(self, font: impl Into<Renderer::Font>) -> Self
Sets the font of the Group header.
Sourcepub fn header_wrapping(self, wrapping: Wrapping) -> Self
pub fn header_wrapping(self, wrapping: Wrapping) -> Self
Sourcepub fn on_launcher_press(self, on_press: Message) -> Self
pub fn on_launcher_press(self, on_press: Message) -> Self
Sets the message that will be sent when the launcher button is pressed.
Sourcepub fn on_collapsed_press(self, on_press: Message) -> Self
pub fn on_collapsed_press(self, on_press: Message) -> Self
Sets the message that will be sent when the Size::Collapsed button is pressed
Sourcepub fn on_collapsed_press_with(
self,
on_press: impl Fn() -> Message + 'a,
) -> Self
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.
Sourcepub fn header_style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
pub fn header_style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
Sets the style of the Group header.