Skip to content

Commit

Permalink
Add horizontal helper to scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 1, 2025
1 parent 91f94f3 commit 8cac532
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions widget/src/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8cac532

Please sign in to comment.