fix: layout fixes for nav bar

This commit is contained in:
Ashley Wulber 2024-02-01 17:29:33 -05:00 committed by Ashley Wulber
parent c571a289b4
commit e778782328
4 changed files with 11 additions and 7 deletions

2
iced

@ -1 +1 @@
Subproject commit 32a0efcd05e827ba3ad9913e50dd103510e8bca7 Subproject commit 73e887bcfb946ec72d21787579721986f99feb8e

View file

@ -449,7 +449,10 @@ where
nav = nav.max_width(300); nav = nav.max_width(300);
} }
Some(Element::from(nav)) Some(Element::from(
// XXX both must be shrink to avoid flex layout from ignoring it
nav.width(iced::Length::Shrink).height(iced::Length::Shrink),
))
} }
/// Allows COSMIC to integrate with your application's [`nav_bar::Model`]. /// Allows COSMIC to integrate with your application's [`nav_bar::Model`].

View file

@ -35,6 +35,7 @@ where
.spacing(8) .spacing(8)
.style(crate::theme::SegmentedButton::ViewSwitcher) .style(crate::theme::SegmentedButton::ViewSwitcher)
.apply(scrollable) .apply(scrollable)
.height(Length::Fill)
.apply(container) .apply(container)
.height(Length::Fill) .height(Length::Fill)
.padding(11) .padding(11)

View file

@ -87,11 +87,11 @@ where
if num != 0 { if num != 0 {
height = (num as f32 * height) + (num as f32 * spacing) - spacing; height = (num as f32 * height) + (num as f32 * spacing) - spacing;
} }
let size = limits.height(Length::Fixed(height)).resolve(
let size = self.width,
limits self.height,
.height(Length::Fixed(height)) Size::new(width, height),
.resolve(width, height, Size::new(width, height)); );
layout::Node::new(size) layout::Node::new(size)
} }