Responsive context drawer width
This commit is contained in:
parent
7d7c6fa71a
commit
10f02d9d6b
4 changed files with 36 additions and 10 deletions
|
|
@ -16,10 +16,11 @@ pub fn context_drawer<'a, Message: Clone + 'static, Content, Drawer>(
|
|||
on_close: Message,
|
||||
content: Content,
|
||||
drawer: Drawer,
|
||||
max_width: f32,
|
||||
) -> ContextDrawer<'a, Message>
|
||||
where
|
||||
Content: Into<Element<'a, Message>>,
|
||||
Drawer: Into<Element<'a, Message>>,
|
||||
{
|
||||
ContextDrawer::new(header, content, drawer, on_close)
|
||||
ContextDrawer::new(header, content, drawer, on_close, max_width)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ impl<'a, Message: Clone + 'static> ContextDrawer<'a, Message> {
|
|||
content: Content,
|
||||
drawer: Drawer,
|
||||
on_close: Message,
|
||||
max_width: f32,
|
||||
) -> Self
|
||||
where
|
||||
Content: Into<Element<'a, Message>>,
|
||||
|
|
@ -92,7 +93,7 @@ impl<'a, Message: Clone + 'static> ContextDrawer<'a, Message> {
|
|||
.style(crate::style::Container::ContextDrawer)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.max_width(480.0),
|
||||
.max_width(max_width),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue