2022-12-06 16:12:59 +01:00
|
|
|
// Copyright 2022 System76 <info@system76.com>
|
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2022-10-12 19:44:44 -07:00
|
|
|
|
2022-12-20 15:06:01 -07:00
|
|
|
pub mod column;
|
2022-12-06 16:12:59 +01:00
|
|
|
// mod item;
|
2022-10-12 19:44:44 -07:00
|
|
|
|
2023-01-03 21:35:35 +01:00
|
|
|
pub use self::column::{list_column, ListColumn};
|
2022-12-20 15:06:01 -07:00
|
|
|
// pub use self::item::{ListItem, list_item};
|
2023-09-13 15:43:24 +02:00
|
|
|
|
|
|
|
|
use crate::widget::Container;
|
|
|
|
|
use crate::Element;
|
|
|
|
|
use iced::{Background, Color};
|
|
|
|
|
|
|
|
|
|
pub fn container<'a, Message>(
|
|
|
|
|
content: impl Into<Element<'a, Message>>,
|
|
|
|
|
) -> Container<'a, Message, crate::Renderer> {
|
|
|
|
|
super::container(content)
|
|
|
|
|
.padding([16, 6])
|
|
|
|
|
.style(crate::theme::Container::custom(style))
|
|
|
|
|
.width(iced::Length::Fill)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
|
|
|
|
#[allow(clippy::trivially_copy_pass_by_ref)]
|
|
|
|
|
pub fn style(theme: &crate::Theme) -> crate::widget::container::Appearance {
|
|
|
|
|
let container = &theme.current_container().component;
|
|
|
|
|
crate::widget::container::Appearance {
|
|
|
|
|
icon_color: Some(container.on.into()),
|
|
|
|
|
text_color: Some(container.on.into()),
|
|
|
|
|
background: Some(Background::Color(container.base.into())),
|
2023-12-13 12:59:26 -05:00
|
|
|
border_radius: theme.cosmic().corner_radii.radius_s.into(),
|
2023-09-13 15:43:24 +02:00
|
|
|
border_width: 0.0,
|
|
|
|
|
border_color: Color::TRANSPARENT,
|
|
|
|
|
}
|
|
|
|
|
}
|