Wire up container styling to iced_native
This commit is contained in:
parent
edea093350
commit
d61cb58d92
17 changed files with 65 additions and 99 deletions
|
|
@ -164,7 +164,7 @@ impl Sandbox for ScrollableDemo {
|
|||
Container::new(scrollable)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.style(*theme),
|
||||
.style(theme.clone().into()),
|
||||
)
|
||||
.push(ProgressBar::new(
|
||||
0.0..=1.0,
|
||||
|
|
@ -190,7 +190,7 @@ impl Sandbox for ScrollableDemo {
|
|||
.height(Length::Fill)
|
||||
.center_x()
|
||||
.center_y()
|
||||
.style(self.theme)
|
||||
.style(self.theme.into())
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ impl Default for Theme {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Theme> for Box<dyn container::StyleSheet> {
|
||||
impl From<Theme> for &'static dyn container::StyleSheet {
|
||||
fn from(theme: Theme) -> Self {
|
||||
match theme {
|
||||
Theme::Light => Default::default(),
|
||||
Theme::Dark => dark::Container.into(),
|
||||
Theme::Dark => &dark::Container,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue