Introduce keyed::Column widget

This commit is contained in:
Héctor Ramón Jiménez 2023-09-04 02:55:09 +02:00
parent 1a1da6a1f0
commit 34495bba1c
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
8 changed files with 490 additions and 11 deletions

View file

@ -6,6 +6,7 @@ use crate::container::{self, Container};
use crate::core;
use crate::core::widget::operation;
use crate::core::{Element, Length, Pixels};
use crate::keyed;
use crate::overlay;
use crate::pick_list::{self, PickList};
use crate::progress_bar::{self, ProgressBar};
@ -63,14 +64,22 @@ where
}
/// Creates a new [`Column`] with the given children.
///
/// [`Column`]: widget::Column
pub fn column<Message, Renderer>(
children: Vec<Element<'_, Message, Renderer>>,
) -> Column<'_, Message, Renderer> {
Column::with_children(children)
}
/// Creates a new [`keyed::Column`] with the given children.
pub fn keyed_column<'a, Key, Message, Renderer>(
children: impl IntoIterator<Item = (Key, Element<'a, Message, Renderer>)>,
) -> keyed::Column<'a, Key, Message, Renderer>
where
Key: Copy + PartialEq,
{
keyed::Column::with_children(children)
}
/// Creates a new [`Row`] with the given children.
///
/// [`Row`]: widget::Row