Move more code to libcosmic

This commit is contained in:
Jeremy Soller 2022-09-30 09:51:00 -06:00
parent 5ad54bd3b1
commit bfcaf829eb
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
4 changed files with 56 additions and 41 deletions

View file

@ -2,13 +2,29 @@ use iced::{
Background,
Color,
Theme,
widget::{
container,
},
widget
};
pub fn nav_bar_style(theme: &Theme) -> container::Appearance {
container::Appearance {
#[macro_export]
macro_rules! nav_bar {
($($x:expr),+ $(,)?) => (
$crate::iced::widget::Container::new(
$crate::iced::widget::Column::with_children(
vec![$($crate::iced::Element::from($x)),+]
)
.spacing(12)
)
.max_width(300)
.padding(12)
.style(theme::Container::Custom(
$crate::widget::nav_bar_style
))
);
}
pub use nav_bar;
pub fn nav_bar_style(theme: &Theme) -> widget::container::Appearance {
widget::container::Appearance {
text_color: None,
background: Some(Background::Color(
match theme {