Skip to content

Commit

Permalink
Pass BarHoveredState by value and add impl Default for ScrollComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
ForLoveOfCats committed Jul 29, 2020
1 parent 803ab74 commit 7f6ea8f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion druid/src/scroll_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7f6ea8f

Please sign in to comment.