diff options
Diffstat (limited to '')
-rw-r--r-- | style/src/theme.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs index c9835ca3..477bd27b 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -139,6 +139,15 @@ pub enum Button { Custom(Box<dyn button::StyleSheet<Style = Theme>>), } +impl Button { + /// Creates a custom [`Button`] style variant. + pub fn custom( + style_sheet: impl button::StyleSheet<Style = Theme> + 'static, + ) -> Self { + Self::Custom(Box::new(style_sheet)) + } +} + impl button::StyleSheet for Theme { type Style = Button; |