Made the navigation bar scrollable

- Added padding to the entries to avoid collisioning with the scrollbar
This commit is contained in:
Eduardo Flores 2022-09-30 15:49:26 -07:00 committed by Michael Murphy
parent 89285d78be
commit 8b73478c57

View file

@ -9,16 +9,17 @@ use iced::{
macro_rules! nav_bar { macro_rules! nav_bar {
($($x:expr),+ $(,)?) => ( ($($x:expr),+ $(,)?) => (
$crate::iced::widget::Container::new( $crate::iced::widget::Container::new(
$crate::iced::widget::Column::with_children(vec![ $crate::iced::widget::scrollable(
$($crate::iced::Element::from($x)),+, $crate::iced::widget::Column::with_children(
$crate::iced::widget::vertical_space( vec![$($crate::iced::Element::from($x)),+]
$crate::iced::Length::Fill )
).into() .spacing(12)
]) .padding([0,20,0,0])
.spacing(12) )
) )
.max_width(300) .max_width(300)
.padding(12) .padding(12)
.height(Length::Fill)
.style(theme::Container::Custom( .style(theme::Container::Custom(
$crate::widget::nav_bar_style $crate::widget::nav_bar_style
)) ))