cosmic/widget/context_drawer/
mod.rs

1// Copyright 2023 System76 <info@system76.com>
2// SPDX-License-Identifier: MPL-2.0
3
4//! An overlayed widget that attaches a toggleable context drawer to the view.
5
6mod overlay;
7
8mod widget;
9use std::borrow::Cow;
10
11pub use widget::ContextDrawer;
12
13use crate::Element;
14
15/// An overlayed widget that attaches a toggleable context drawer to the view.
16pub fn context_drawer<'a, Message: Clone + 'static, Content, Drawer>(
17    title: Option<Cow<'a, str>>,
18    actions: Option<Element<'a, Message>>,
19    header: Option<Element<'a, Message>>,
20    footer: Option<Element<'a, Message>>,
21    on_close: Message,
22    content: Content,
23    drawer: Drawer,
24    max_width: f32,
25) -> ContextDrawer<'a, Message>
26where
27    Content: Into<Element<'a, Message>>,
28    Drawer: Into<Element<'a, Message>>,
29{
30    ContextDrawer::new(
31        title, actions, header, footer, content, drawer, on_close, max_width,
32    )
33}