summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-30 22:21:52 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-30 22:21:52 +0200
commit9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d (patch)
tree7be4429f26ae4adbe701a444240f506ed7f0e1a0
parent10f367a31375e127f61ed5c45b69d1e120af7e16 (diff)
downloadiced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.tar.gz
iced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.tar.bz2
iced-9be509d3b3301ee0b9b3379cd1e814fc3aa5e56d.zip
Reintroduce `Scrollable::with_direction`
-rw-r--r--widget/src/scrollable.rs10
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(),