diff options
author | 2024-07-30 22:21:52 +0200 | |
---|---|---|
committer | 2024-07-30 22:21:52 +0200 | |
commit | 9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d (patch) | |
tree | 7be4429f26ae4adbe701a444240f506ed7f0e1a0 | |
parent | 10f367a31375e127f61ed5c45b69d1e120af7e16 (diff) | |
download | iced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.tar.gz iced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.tar.bz2 iced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.zip |
Reintroduce `Scrollable::with_direction`
-rw-r--r-- | widget/src/scrollable.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 6dd593cb..9ba8c39b 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -50,11 +50,19 @@ where 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(), |