Implement custom helper for theme::Button
This commit is contained in:
parent
59663d2e45
commit
96aa0379d5
2 changed files with 15 additions and 8 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue