From 8cac532cd9355a96c010a1c693f266fadd511680 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 1 Feb 2025 04:26:35 +0100 Subject: Add `horizontal` helper to `scrollable` --- widget/src/scrollable.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'widget') diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 9ba8cdea..312aee29 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -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) -> Self { self.direction = direction.into(); -- cgit