Introduce an appearance for a scrollable, ability to customize the scrollbar gap.
Update scrollable.rs
This commit is contained in:
parent
891f29eea0
commit
0f920e0435
4 changed files with 71 additions and 6 deletions
|
|
@ -1188,6 +1188,20 @@ impl Scrollable {
|
|||
impl scrollable::StyleSheet for Theme {
|
||||
type Style = Scrollable;
|
||||
|
||||
fn appearance(&self, style: &Self::Style) -> scrollable::Appearance {
|
||||
match style {
|
||||
Scrollable::Default => {
|
||||
let palette = self.extended_palette();
|
||||
|
||||
scrollable::Appearance {
|
||||
background: None,
|
||||
gap: Some(palette.background.weak.color.into()),
|
||||
}
|
||||
}
|
||||
Scrollable::Custom(custom) => custom.appearance(self),
|
||||
}
|
||||
}
|
||||
|
||||
fn active(&self, style: &Self::Style) -> scrollable::Scrollbar {
|
||||
match style {
|
||||
Scrollable::Default => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue