Add horizontal helper to scrollable

This commit is contained in:
Héctor Ramón Jiménez 2025-02-01 04:26:35 +01:00
parent 91f94f3b6e
commit 8cac532cd9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -137,6 +137,11 @@ where
self
}
/// Makes the [`Scrollable`] scroll horizontally, with default [`Scrollbar`] settings.
pub fn horizontal(self) -> Self {
self.direction(Direction::Horizontal(Scrollbar::default()))
}
/// Sets the [`Direction`] of the [`Scrollable`].
pub fn direction(mut self, direction: impl Into<Direction>) -> Self {
self.direction = direction.into();