diff --git a/druid/src/scroll_component.rs b/druid/src/scroll_component.rs index eedd2df13e..ffc75f9307 100644 --- a/druid/src/scroll_component.rs +++ b/druid/src/scroll_component.rs @@ -33,7 +33,7 @@ pub enum BarHoveredState { } impl BarHoveredState { - pub fn is_hovered(&self) -> bool { + pub fn is_hovered(self) -> bool { match self { BarHoveredState::Vertical | BarHoveredState::Horizontal => true, _ => false, @@ -88,6 +88,12 @@ pub struct ScrollComponent { pub scrollbars: ScrollbarsState, } +impl Default for ScrollComponent { + fn default() -> Self { + ScrollComponent::new() + } +} + impl ScrollComponent { pub fn new() -> ScrollComponent { ScrollComponent {