clean up rebase mistake

This commit is contained in:
Casper Storm 2023-05-23 19:42:01 +02:00
parent 1234d52812
commit 25804d9e5a

View file

@ -289,18 +289,13 @@ impl Application for ScrollableDemo {
} }
Direction::Horizontal => { Direction::Horizontal => {
progress_bar(0.0..=1.0, self.current_scroll_offset.x) progress_bar(0.0..=1.0, self.current_scroll_offset.x)
.style(theme::ProgressBar::Custom(Box::new( .style(progress_bar_custom_style)
ProgressBarCustomStyle,
)))
.into() .into()
} }
Direction::Multi => column![ Direction::Multi => column![
progress_bar(0.0..=1.0, self.current_scroll_offset.y), 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(0.0..=1.0, self.current_scroll_offset.x)
theme::ProgressBar::Custom(Box::new( .style(progress_bar_custom_style)
ProgressBarCustomStyle,
))
)
] ]
.spacing(10) .spacing(10)
.into(), .into(),
@ -372,16 +367,10 @@ impl scrollable::StyleSheet for ScrollbarCustomStyle {
} }
} }
struct ProgressBarCustomStyle; fn progress_bar_custom_style(theme: &Theme) -> progress_bar::Appearance {
progress_bar::Appearance {
impl progress_bar::StyleSheet for ProgressBarCustomStyle { background: theme.extended_palette().background.strong.color.into(),
type Style = Theme; bar: Color::from_rgb8(250, 85, 134).into(),
border_radius: 0.0.into(),
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(),
}
} }
} }