refactor(container): make layer optional and export as container
This commit is contained in:
parent
8d968f931d
commit
b35af255b4
2 changed files with 58 additions and 52 deletions
|
|
@ -2,11 +2,11 @@ use apply::Apply;
|
|||
use cosmic::{
|
||||
cosmic_theme,
|
||||
iced::widget::{checkbox, pick_list, progress_bar, radio, row, slider, text},
|
||||
iced::{widget::container, Alignment, Length},
|
||||
iced::{Alignment, Length},
|
||||
theme::{self, Button as ButtonTheme, Theme},
|
||||
widget::{
|
||||
button, cosmic_container, icon, segmented_button, segmented_selection, settings,
|
||||
spin_button, toggler, view_switcher,
|
||||
button, container, icon, segmented_button, segmented_selection, settings, spin_button,
|
||||
toggler, view_switcher,
|
||||
},
|
||||
Element,
|
||||
};
|
||||
|
|
@ -375,27 +375,21 @@ impl State {
|
|||
.into()
|
||||
}
|
||||
},
|
||||
cosmic_container(
|
||||
text("Background container with some text").size(24),
|
||||
cosmic_theme::Layer::Background,
|
||||
)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
cosmic_container(
|
||||
text("Primary container with some text").size(24),
|
||||
cosmic_theme::Layer::Primary,
|
||||
)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
cosmic_container(
|
||||
text("Secondary container with some text").size(24),
|
||||
cosmic_theme::Layer::Secondary,
|
||||
)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
container(text("Background container with some text").size(24))
|
||||
.layer(cosmic_theme::Layer::Background)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
container(text("Primary container with some text").size(24))
|
||||
.layer(cosmic_theme::Layer::Primary)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
container(text("Secondary container with some text").size(24))
|
||||
.layer(cosmic_theme::Layer::Secondary)
|
||||
.padding(8)
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
])
|
||||
.into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue