summaryrefslogtreecommitdiff
path: root/crates/material_theme/src/progress_bar.rs
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-04-17 00:39:06 +0200
committerpml68 <contact@pml68.dev>2025-04-17 00:39:06 +0200
commita1d4112532a41c32ad3ef4d301f1603ae73c50ab (patch)
tree1d5f2e6319a229c477e6af9022a5bd062ece20f6 /crates/material_theme/src/progress_bar.rs
parentfeat(material_theme): implement `combo_box::Catalog` (diff)
downloadiced-builder-a1d4112532a41c32ad3ef4d301f1603ae73c50ab.tar.gz
feat(material_theme): implement `progress_bar::Catalog`
Diffstat (limited to 'crates/material_theme/src/progress_bar.rs')
-rw-r--r--crates/material_theme/src/progress_bar.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/material_theme/src/progress_bar.rs b/crates/material_theme/src/progress_bar.rs
new file mode 100644
index 0000000..f686fff
--- /dev/null
+++ b/crates/material_theme/src/progress_bar.rs
@@ -0,0 +1,26 @@
+use iced_widget::core::{Background, border};
+use iced_widget::progress_bar::{Catalog, Style, StyleFn};
+
+use super::Theme;
+
+impl Catalog for Theme {
+ type Class<'a> = StyleFn<'a, Self>;
+
+ fn default<'a>() -> Self::Class<'a> {
+ Box::new(default)
+ }
+
+ fn style(&self, class: &Self::Class<'_>) -> Style {
+ class(self)
+ }
+}
+
+pub fn default(theme: &Theme) -> Style {
+ Style {
+ background: Background::Color(
+ theme.colorscheme.secondary.secondary_container,
+ ),
+ bar: Background::Color(theme.colorscheme.primary.color),
+ border: border::rounded(400),
+ }
+}