summaryrefslogtreecommitdiffstats
path: root/style/src/theme.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-05 22:38:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-05 22:38:27 +0100
commita43afc791e8f78b03d802f980a10f32dc932f0b2 (patch)
tree9bfc21e139dc5572dfe84734bb3365aeb803a838 /style/src/theme.rs
parent420f49bef5f6938868a84086e729deaa1df9107f (diff)
downloadiced-a43afc791e8f78b03d802f980a10f32dc932f0b2.tar.gz
iced-a43afc791e8f78b03d802f980a10f32dc932f0b2.tar.bz2
iced-a43afc791e8f78b03d802f980a10f32dc932f0b2.zip
Simplify theming for `Rule` widget
Diffstat (limited to 'style/src/theme.rs')
-rw-r--r--style/src/theme.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 8ed15408..a7a95ab0 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -8,7 +8,6 @@ use crate::core::widget::text;
use crate::menu;
use crate::pane_grid;
use crate::pick_list;
-use crate::rule;
use crate::svg;
use crate::text_editor;
use crate::toggler;
@@ -511,48 +510,6 @@ impl pane_grid::StyleSheet for Theme {
}
}
-/// The style of a rule.
-#[derive(Default)]
-pub enum Rule {
- /// The default style.
- #[default]
- Default,
- /// A custom style.
- Custom(Box<dyn rule::StyleSheet<Style = Theme>>),
-}
-
-impl<T: Fn(&Theme) -> rule::Appearance + 'static> From<T> for Rule {
- fn from(f: T) -> Self {
- Self::Custom(Box::new(f))
- }
-}
-
-impl rule::StyleSheet for Theme {
- type Style = Rule;
-
- fn appearance(&self, style: &Self::Style) -> rule::Appearance {
- let palette = self.extended_palette();
-
- match style {
- Rule::Default => rule::Appearance {
- color: palette.background.strong.color,
- width: 1,
- radius: 0.0.into(),
- fill_mode: rule::FillMode::Full,
- },
- Rule::Custom(custom) => custom.appearance(self),
- }
- }
-}
-
-impl<T: Fn(&Theme) -> rule::Appearance> rule::StyleSheet for T {
- type Style = Theme;
-
- fn appearance(&self, style: &Self::Style) -> rule::Appearance {
- (self)(style)
- }
-}
-
/**
* Svg
*/