Skip to content

Commit

Permalink
added function focused and focused_horizontal to theme.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Jan 23, 2023
1 parent eaa2238 commit 49e9a9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native/src/widget/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ pub fn draw<Renderer>(
} else if mouse_over_scrollable {
theme.focused(style)
} else {
theme.focused(style)
theme.active(style)
};

draw_scrollbar(renderer, style, &scrollbar);
Expand All @@ -874,7 +874,7 @@ pub fn draw<Renderer>(
} else if mouse_over_scrollable {
theme.focused_horizontal(style)
} else {
theme.focused_horizontal(style)
theme.active_horizontal(style)
};

draw_scrollbar(renderer, style, &scrollbar);
Expand Down
17 changes: 17 additions & 0 deletions style/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,13 @@ impl scrollable::StyleSheet for Theme {
}
}

fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar {
match style {
Scrollable::Default => self.active(style),
Scrollable::Custom(custom) => custom.focused(self),
}
}

fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar {
match style {
Scrollable::Default => self.active(style),
Expand All @@ -958,6 +965,16 @@ impl scrollable::StyleSheet for Theme {
Scrollable::Custom(custom) => custom.dragging_horizontal(self),
}
}

fn focused_horizontal(
&self,
style: &Self::Style,
) -> scrollable::Scrollbar {
match style {
Scrollable::Default => self.active_horizontal(style),
Scrollable::Custom(custom) => custom.focused_horizontal(self),
}
}
}

/// The style of text.
Expand Down

0 comments on commit 49e9a9a

Please sign in to comment.