Simplify nav button and add pick list
This commit is contained in:
parent
153437b3b0
commit
472135df09
3 changed files with 53 additions and 32 deletions
|
|
@ -7,8 +7,8 @@ pub use self::icon::*;
|
|||
mod list;
|
||||
pub use list::*;
|
||||
|
||||
mod nav_bar;
|
||||
pub use nav_bar::*;
|
||||
mod nav;
|
||||
pub use nav::*;
|
||||
|
||||
mod toggler;
|
||||
pub use toggler::*;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,12 @@ use iced::{
|
|||
macro_rules! nav_bar {
|
||||
($($x:expr),+ $(,)?) => (
|
||||
$crate::iced::widget::Container::new(
|
||||
$crate::iced::widget::Column::with_children(
|
||||
vec![$($crate::iced::Element::from($x)),+]
|
||||
)
|
||||
$crate::iced::widget::Column::with_children(vec![
|
||||
$($crate::iced::Element::from($x)),+,
|
||||
$crate::iced::widget::vertical_space(
|
||||
$crate::iced::Length::Fill
|
||||
).into()
|
||||
])
|
||||
.spacing(12)
|
||||
)
|
||||
.max_width(300)
|
||||
|
|
@ -37,3 +40,17 @@ pub fn nav_bar_style(theme: &Theme) -> widget::container::Appearance {
|
|||
border_color: Color::TRANSPARENT,
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! nav_button {
|
||||
($icon: expr, $title:expr) => (
|
||||
$crate::widget::button!(
|
||||
$crate::widget::icon($icon, 16),
|
||||
$crate::iced::widget::Text::new($title),
|
||||
$crate::iced::widget::horizontal_space(
|
||||
$crate::iced::Length::Fill
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
pub use nav_button;
|
||||
Loading…
Add table
Add a link
Reference in a new issue