summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 70ebebe2..2b699e3b 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -6,7 +6,7 @@ use crate::mouse;
use crate::overlay;
use crate::touch;
use crate::{
- Align, Clipboard, Column, Element, Hasher, Layout, Length, Point,
+ Align, Clipboard, Column, Element, Hasher, Layout, Length, Padding, Point,
Rectangle, Size, Vector, Widget,
};
@@ -51,9 +51,14 @@ impl<'a, Message, Renderer: self::Renderer> Scrollable<'a, Message, Renderer> {
self
}
- /// Sets the padding of the [`Scrollable`].
- pub fn padding(mut self, units: u16) -> Self {
- self.content = self.content.padding(units);
+ /// Sets the [`Padding`] of the [`Scrollable`].
+ ///```ignore
+ /// Scrollable::new(/*...*/).padding(20); // 20px on all sides
+ /// Scrollable::new(/*...*/).padding([10, 20]); // top/bottom, left/right
+ /// Scrollable::new(/*...*/).padding([5, 10, 15, 20]); // top, right, bottom, left
+ /// ```
+ pub fn padding<P: Into<Padding>>(mut self, padding: P) -> Self {
+ self.content = self.content.padding(padding);
self
}