feat(widget): add ContextDrawer widget
This commit is contained in:
parent
8c86dae449
commit
3127de3296
4 changed files with 383 additions and 0 deletions
22
src/widget/context_drawer/mod.rs
Normal file
22
src/widget/context_drawer/mod.rs
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue