From 602565f98f3a22fa1c39e054c6a88b3c31a36599 Mon Sep 17 00:00:00 2001 From: pml68 Date: Thu, 26 Jun 2025 11:41:52 +0200 Subject: feat: initial commit --- src/progress_bar.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/progress_bar.rs (limited to 'src/progress_bar.rs') diff --git a/src/progress_bar.rs b/src/progress_bar.rs new file mode 100644 index 0000000..9b4e844 --- /dev/null +++ b/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.colors().secondary.secondary_container, + ), + bar: Background::Color(theme.colors().primary.color), + border: border::rounded(400), + } +} -- cgit v1.2.3