Reworked Scrollable to account for lack of widget order guarantees.

Fixed thumb "snapping" bug on scrollable when cursor is out of bounds.
This commit is contained in:
bungoboingo 2022-12-24 21:27:44 -08:00
parent d91f4f6aa7
commit 9f85e0c721
9 changed files with 624 additions and 697 deletions

View file

@ -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;