summaryrefslogtreecommitdiffstats
path: root/style/src/theme.rs
diff options
context:
space:
mode:
Diffstat (limited to 'style/src/theme.rs')
-rw-r--r--style/src/theme.rs9
1 files changed, 9 insertions, 0 deletions
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<dyn scrollable::StyleSheet<Style = Theme>>),
}
+impl Scrollable {
+ /// Creates a custom [`Scrollable`] theme.
+ pub fn custom<T: scrollable::StyleSheet<Style = Theme> + 'static>(
+ style: T,
+ ) -> Self {
+ Self::Custom(Box::new(style))
+ }
+}
+
impl scrollable::StyleSheet for Theme {
type Style = Scrollable;