Infinite List widget from upstream feature/list-widget-reloaded branch
This commit is contained in:
parent
6829724ac0
commit
0b068e486e
6 changed files with 932 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ use crate::core::window;
|
|||
use crate::core::{Element, Length, Size, Widget};
|
||||
use crate::float::{self, Float};
|
||||
use crate::keyed;
|
||||
use crate::list::{self, List};
|
||||
use crate::overlay;
|
||||
use crate::pane_grid::{self, PaneGrid};
|
||||
use crate::pick_list::{self, PickList};
|
||||
|
|
@ -1054,6 +1055,18 @@ where
|
|||
Scrollable::new(content)
|
||||
}
|
||||
|
||||
/// Creates a new [`List`] with the provided [`Content`] and
|
||||
/// closure to view an item of the [`List`].
|
||||
///
|
||||
/// [`List`]: crate::List
|
||||
/// [`Content`]: crate::list::Content
|
||||
pub fn list<'a, T, Message, Theme, Renderer>(
|
||||
content: &'a list::Content<T>,
|
||||
view_item: impl Fn(usize, &'a T) -> Element<'a, Message, Theme, Renderer> + 'a,
|
||||
) -> List<'a, T, Message, Theme, Renderer> {
|
||||
List::new(content, view_item)
|
||||
}
|
||||
|
||||
/// Creates a new [`Button`] with the provided content.
|
||||
///
|
||||
/// # Example
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue