From a43afc791e8f78b03d802f980a10f32dc932f0b2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 5 Mar 2024 22:38:27 +0100 Subject: Simplify theming for `Rule` widget --- style/src/theme.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'style/src/theme.rs') 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>), -} - -impl rule::Appearance + 'static> From 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 rule::Appearance> rule::StyleSheet for T { - type Style = Theme; - - fn appearance(&self, style: &Self::Style) -> rule::Appearance { - (self)(style) - } -} - /** * Svg */ -- cgit