From 9f85e0c721927f1e3bd195a998ec7a80ec0e7455 Mon Sep 17 00:00:00 2001 From: bungoboingo Date: Sat, 24 Dec 2022 21:27:44 -0800 Subject: Reworked Scrollable to account for lack of widget order guarantees. Fixed thumb "snapping" bug on scrollable when cursor is out of bounds. --- style/src/theme.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index cef8f2be..f780f952 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -872,6 +872,15 @@ pub enum Scrollable { Custom(Box>), } +impl Scrollable { + /// Creates a custom [`Scrollable`] theme. + pub fn custom + 'static>( + style: T, + ) -> Self { + Self::Custom(Box::new(style)) + } +} + impl scrollable::StyleSheet for Theme { type Style = Scrollable; -- cgit