Reintroduce Scrollable::with_direction

This commit is contained in:
Héctor Ramón Jiménez 2024-07-30 22:21:52 +02:00
parent 10f367a313
commit 9be509d3b3
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -49,12 +49,20 @@ where
/// Creates a new vertical [`Scrollable`].
pub fn new(
content: impl Into<Element<'a, Message, Theme, Renderer>>,
) -> Self {
Self::with_direction(content, Direction::default())
}
/// Creates a new vertical [`Scrollable`].
pub fn with_direction(
content: impl Into<Element<'a, Message, Theme, Renderer>>,
direction: impl Into<Direction>,
) -> Self {
Scrollable {
id: None,
width: Length::Shrink,
height: Length::Shrink,
direction: Direction::default(),
direction: direction.into(),
content: content.into(),
on_scroll: None,
class: Theme::default(),