Wire up styling to Button in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-18 16:02:30 +07:00
parent 95acc1deb8
commit 3140cdc4ba
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
12 changed files with 55 additions and 96 deletions

View file

@ -51,7 +51,7 @@ pub struct Button<'a, Message> {
#[allow(dead_code)]
min_height: u32,
padding: Padding,
style: Box<dyn StyleSheet>,
style: &'a dyn StyleSheet,
}
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: impl Into<Box<dyn StyleSheet>>) -> Self {
self.style = style.into();
pub fn style(mut self, style: &'a dyn StyleSheet) -> Self {
self.style = style;
self
}