feat(widget): add ContextDrawer widget

This commit is contained in:
Michael Aaron Murphy 2023-10-12 13:23:21 +02:00 committed by Michael Murphy
parent 8c86dae449
commit 3127de3296
4 changed files with 383 additions and 0 deletions

View file

@ -0,0 +1,22 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
mod overlay;
mod widget;
pub use widget::ContextDrawer;
use crate::Element;
pub fn context_drawer<'a, Message: Clone + 'static, Content, Drawer>(
header: &'a str,
on_close: Message,
content: Content,
drawer: Drawer,
) -> ContextDrawer<'a, Message>
where
Content: Into<Element<'a, Message>>,
Drawer: Into<Element<'a, Message>>,
{
ContextDrawer::new(header, content, drawer, on_close)
}