Reintroduce Box for style_sheet in Button
This commit is contained in:
parent
661cb5736e
commit
d36ce33a95
10 changed files with 42 additions and 30 deletions
|
|
@ -51,7 +51,7 @@ pub struct Button<'a, Message> {
|
|||
#[allow(dead_code)]
|
||||
min_height: u32,
|
||||
padding: Padding,
|
||||
style: &'a dyn StyleSheet,
|
||||
style: Box<dyn StyleSheet + 'a>,
|
||||
}
|
||||
|
||||
impl<'a, Message> Button<'a, Message> {
|
||||
|
|
@ -104,8 +104,8 @@ impl<'a, Message> Button<'a, Message> {
|
|||
}
|
||||
|
||||
/// Sets the style of the [`Button`].
|
||||
pub fn style(mut self, style: &'a dyn StyleSheet) -> Self {
|
||||
self.style = style;
|
||||
pub fn style(mut self, style: impl Into<Box<dyn StyleSheet + 'a>>) -> Self {
|
||||
self.style = style.into();
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue