summaryrefslogtreecommitdiffstats
path: root/examples/scrollable
diff options
context:
space:
mode:
authorLibravatar Casper Storm <casper.storm@lich.io>2023-05-23 19:42:01 +0200
committerLibravatar Casper Storm <casper.storm@lich.io>2023-05-23 19:42:01 +0200
commit25804d9e5ad67d26fafb437057bc0fddde04512a (patch)
treeb03c16cd71c4f2b79c87e2fa7a605ed0e5f901d5 /examples/scrollable
parent1234d528121265698f9f426ca89fc687dc95dc01 (diff)
downloadiced-25804d9e5ad67d26fafb437057bc0fddde04512a.tar.gz
iced-25804d9e5ad67d26fafb437057bc0fddde04512a.tar.bz2
iced-25804d9e5ad67d26fafb437057bc0fddde04512a.zip
clean up rebase mistake
Diffstat (limited to 'examples/scrollable')
-rw-r--r--examples/scrollable/src/main.rs27
1 files changed, 8 insertions, 19 deletions
diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs
index efc880e3..3038661e 100644
--- a/examples/scrollable/src/main.rs
+++ b/examples/scrollable/src/main.rs
@@ -289,18 +289,13 @@ impl Application for ScrollableDemo {
}
Direction::Horizontal => {
progress_bar(0.0..=1.0, self.current_scroll_offset.x)
- .style(theme::ProgressBar::Custom(Box::new(
- ProgressBarCustomStyle,
- )))
+ .style(progress_bar_custom_style)
.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(
- theme::ProgressBar::Custom(Box::new(
- ProgressBarCustomStyle,
- ))
- )
+ progress_bar(0.0..=1.0, self.current_scroll_offset.x)
+ .style(progress_bar_custom_style)
]
.spacing(10)
.into(),
@@ -372,16 +367,10 @@ impl scrollable::StyleSheet for ScrollbarCustomStyle {
}
}
-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(),
- }
+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(),
}
}