Move list_view to libcosmic
This commit is contained in:
parent
bfcaf829eb
commit
8e42dc46ea
3 changed files with 97 additions and 92 deletions
|
|
@ -2,13 +2,28 @@ use iced::{
|
|||
Background,
|
||||
Color,
|
||||
Theme,
|
||||
widget::{
|
||||
container,
|
||||
},
|
||||
widget,
|
||||
};
|
||||
|
||||
pub fn list_view_style(theme: &Theme) -> container::Appearance {
|
||||
container::Appearance {
|
||||
#[macro_export]
|
||||
macro_rules! list_view {
|
||||
($($x:expr),+ $(,)?) => (
|
||||
$crate::iced::widget::Container::new(
|
||||
$crate::iced::widget::Column::with_children(
|
||||
vec![$($crate::iced::Element::from($x)),+]
|
||||
)
|
||||
.spacing(12)
|
||||
)
|
||||
.padding([12, 16])
|
||||
.style(theme::Container::Custom(
|
||||
$crate::widget::list_view_style
|
||||
))
|
||||
);
|
||||
}
|
||||
pub use list_view;
|
||||
|
||||
pub fn list_view_style(theme: &Theme) -> widget::container::Appearance {
|
||||
widget::container::Appearance {
|
||||
text_color: None,
|
||||
background: Some(Background::Color(
|
||||
match theme {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ mod icon;
|
|||
pub use self::icon::icon;
|
||||
|
||||
mod list_view;
|
||||
pub use list_view::list_view_style;
|
||||
pub use list_view::{list_view, list_view_style};
|
||||
|
||||
mod nav_bar;
|
||||
pub use nav_bar::{nav_bar, nav_bar_style};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue