Ashley Wulber 2022-09-10 22:15:25 -04:00 committed by Héctor Ramón Jiménez
parent d5a933b047
commit 4f3215f48e
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 12 additions and 9 deletions

View file

@ -207,7 +207,7 @@ impl Application for ScrollableDemo {
}
fn theme(&self) -> Theme {
self.theme
self.theme.clone()
}
}

View file

@ -53,7 +53,10 @@ impl Sandbox for Styling {
};
let extended = Extended::generate(palette);
Styling {
custom_theme: Theme::Custom { palette, extended },
custom_theme: Theme::Custom {
palette: Box::new(palette),
extended: Box::new(extended)
},
..Default::default()
}
}
@ -67,7 +70,7 @@ impl Sandbox for Styling {
Message::ThemeChanged(theme) => self.theme = match theme {
ThemeType::Light => Theme::Light,
ThemeType::Dark => Theme::Dark,
ThemeType::Custom => self.custom_theme,
ThemeType::Custom => self.custom_theme.clone(),
},
Message::InputChanged(value) => self.input_value = value,
Message::ButtonPressed => {}
@ -163,6 +166,6 @@ impl Sandbox for Styling {
}
fn theme(&self) -> Theme {
self.theme
self.theme.clone()
}
}