feat: inner-app dialog API support
This commit is contained in:
parent
43b478ee68
commit
29f0489c8a
3 changed files with 23 additions and 2 deletions
|
|
@ -136,13 +136,20 @@ impl<Message: 'static> Binder<Message> {
|
|||
page.downcast_ref::<P>()
|
||||
}
|
||||
|
||||
/// Obtain a reference to a page by its type ID.
|
||||
/// Create a context drawer for the given page.
|
||||
#[must_use]
|
||||
pub fn context_drawer(&self, id: crate::Entity) -> Option<Element<'_, Message>> {
|
||||
let page = self.page.get(id)?;
|
||||
page.context_drawer()
|
||||
}
|
||||
|
||||
/// Create a dialog for the given page.
|
||||
#[must_use]
|
||||
pub fn dialog(&self, id: crate::Entity) -> Option<Element<'_, Message>> {
|
||||
let page = self.page.get(id)?;
|
||||
page.dialog()
|
||||
}
|
||||
|
||||
/// Obtain a reference to a page by its type ID.
|
||||
#[must_use]
|
||||
pub fn page_mut<P: Page<Message>>(&mut self) -> Option<&mut P> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue