Skip to content

Commit

Permalink
rebase with master
Browse files Browse the repository at this point in the history
  • Loading branch information
casperstorm committed May 23, 2023
1 parent c6f9de4 commit 6d7bafc
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions examples/scrollable/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,18 @@ impl Application for ScrollableDemo {
}
Direction::Horizontal => {
progress_bar(0.0..=1.0, self.current_scroll_offset.x)
.style(progress_bar_custom_style)
.style(theme::ProgressBar::Custom(Box::new(
ProgressBarCustomStyle,
)))
.into()
}
Direction::Multi => column![
progress_bar(0.0..=1.0, self.current_scroll_offset.y),
progress_bar(0.0..=1.0, self.current_scroll_offset.x)
.style(progress_bar_custom_style)
progress_bar(0.0..=1.0, self.current_scroll_offset.x).style(
theme::ProgressBar::Custom(Box::new(
ProgressBarCustomStyle,
))
)
]
.spacing(10)
.into(),
Expand Down Expand Up @@ -351,12 +356,12 @@ impl scrollable::StyleSheet for ScrollbarCustomStyle {
background: style
.active(&theme::Scrollable::default())
.background,
border_radius: 0.0,
border_radius: 0.0.into(),
border_width: 0.0,
border_color: Default::default(),
scroller: Scroller {
color: Color::from_rgb8(250, 85, 134),
border_radius: 0.0,
border_radius: 0.0.into(),
border_width: 0.0,
border_color: Default::default(),
},
Expand All @@ -367,10 +372,16 @@ impl scrollable::StyleSheet for ScrollbarCustomStyle {
}
}

fn progress_bar_custom_style(theme: &Theme) -> progress_bar::Appearance {
progress_bar::Appearance {
background: theme.extended_palette().background.strong.color.into(),
bar: Color::from_rgb8(250, 85, 134).into(),
border_radius: 0.0.into(),
struct ProgressBarCustomStyle;

impl progress_bar::StyleSheet for ProgressBarCustomStyle {
type Style = Theme;

fn appearance(&self, style: &Self::Style) -> progress_bar::Appearance {
progress_bar::Appearance {
background: style.extended_palette().background.strong.color.into(),
bar: Color::from_rgb8(250, 85, 134).into(),
border_radius: 0.0.into(),
}
}
}

0 comments on commit 6d7bafc

Please sign in to comment.