pub trait ContextModal: Sized {
Show 14 methods
// Required methods
fn open_drawer<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static;
fn open_drawer_at<F>(
&mut self,
placement: Placement,
cx: &mut App,
build: F,
)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static;
fn has_active_drawer(&mut self, cx: &mut App) -> bool;
fn close_drawer(&mut self, cx: &mut App);
fn open_modal<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Modal, &mut Window, &mut App) -> Modal + 'static;
fn has_active_modal(&mut self, cx: &mut App) -> bool;
fn close_modal(&mut self, cx: &mut App);
fn close_all_modals(&mut self, cx: &mut App);
fn push_notification(&mut self, note: impl Into<Notification>, cx: &mut App);
fn remove_notification<T: Sized + 'static>(&mut self, cx: &mut App);
fn clear_notifications(&mut self, cx: &mut App);
fn notifications(&mut self, cx: &mut App) -> Rc<Vec<Entity<Notification>>>;
fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>;
fn has_focused_input(&mut self, cx: &mut App) -> bool;
}
Expand description
Extension trait for [WindowContext
] and [ViewContext
] to add drawer functionality.
Required Methods§
Sourcefn open_drawer<F>(&mut self, cx: &mut App, build: F)
fn open_drawer<F>(&mut self, cx: &mut App, build: F)
Opens a Drawer at right placement.
Sourcefn open_drawer_at<F>(&mut self, placement: Placement, cx: &mut App, build: F)
fn open_drawer_at<F>(&mut self, placement: Placement, cx: &mut App, build: F)
Opens a Drawer at the given placement.
Sourcefn has_active_drawer(&mut self, cx: &mut App) -> bool
fn has_active_drawer(&mut self, cx: &mut App) -> bool
Return true, if there is an active Drawer.
Sourcefn close_drawer(&mut self, cx: &mut App)
fn close_drawer(&mut self, cx: &mut App)
Closes the active Drawer.
Sourcefn open_modal<F>(&mut self, cx: &mut App, build: F)
fn open_modal<F>(&mut self, cx: &mut App, build: F)
Opens a Modal.
Sourcefn has_active_modal(&mut self, cx: &mut App) -> bool
fn has_active_modal(&mut self, cx: &mut App) -> bool
Return true, if there is an active Modal.
Sourcefn close_modal(&mut self, cx: &mut App)
fn close_modal(&mut self, cx: &mut App)
Closes the last active Modal.
Sourcefn close_all_modals(&mut self, cx: &mut App)
fn close_all_modals(&mut self, cx: &mut App)
Closes all active Modals.
Sourcefn push_notification(&mut self, note: impl Into<Notification>, cx: &mut App)
fn push_notification(&mut self, note: impl Into<Notification>, cx: &mut App)
Pushes a notification to the notification list.
Sourcefn remove_notification<T: Sized + 'static>(&mut self, cx: &mut App)
fn remove_notification<T: Sized + 'static>(&mut self, cx: &mut App)
Removes the notification with the given id.
Sourcefn clear_notifications(&mut self, cx: &mut App)
fn clear_notifications(&mut self, cx: &mut App)
Clears all notifications.
Sourcefn notifications(&mut self, cx: &mut App) -> Rc<Vec<Entity<Notification>>>
fn notifications(&mut self, cx: &mut App) -> Rc<Vec<Entity<Notification>>>
Returns number of notifications.
Sourcefn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>
fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>
Return current focused Input entity.
Sourcefn has_focused_input(&mut self, cx: &mut App) -> bool
fn has_focused_input(&mut self, cx: &mut App) -> bool
Returns true if there is a focused Input entity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.