ContextModal

Trait ContextModal 

Source
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§

Source

fn open_drawer<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static,

Opens a Drawer at right placement.

Source

fn open_drawer_at<F>(&mut self, placement: Placement, cx: &mut App, build: F)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static,

Opens a Drawer at the given placement.

Source

fn has_active_drawer(&mut self, cx: &mut App) -> bool

Return true, if there is an active Drawer.

Source

fn close_drawer(&mut self, cx: &mut App)

Closes the active Drawer.

Source

fn open_modal<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Modal, &mut Window, &mut App) -> Modal + 'static,

Opens a Modal.

Source

fn has_active_modal(&mut self, cx: &mut App) -> bool

Return true, if there is an active Modal.

Source

fn close_modal(&mut self, cx: &mut App)

Closes the last active Modal.

Source

fn close_all_modals(&mut self, cx: &mut App)

Closes all active Modals.

Source

fn push_notification(&mut self, note: impl Into<Notification>, cx: &mut App)

Pushes a notification to the notification list.

Source

fn remove_notification<T: Sized + 'static>(&mut self, cx: &mut App)

Removes the notification with the given id.

Source

fn clear_notifications(&mut self, cx: &mut App)

Clears all notifications.

Source

fn notifications(&mut self, cx: &mut App) -> Rc<Vec<Entity<Notification>>>

Returns number of notifications.

Source

fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>

Return current focused Input entity.

Source

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.

Implementations on Foreign Types§

Source§

impl ContextModal for Window

Source§

fn open_drawer<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static,

Source§

fn open_drawer_at<F>(&mut self, placement: Placement, cx: &mut App, build: F)
where F: Fn(Drawer, &mut Window, &mut App) -> Drawer + 'static,

Source§

fn has_active_drawer(&mut self, cx: &mut App) -> bool

Source§

fn close_drawer(&mut self, cx: &mut App)

Source§

fn open_modal<F>(&mut self, cx: &mut App, build: F)
where F: Fn(Modal, &mut Window, &mut App) -> Modal + 'static,

Source§

fn has_active_modal(&mut self, cx: &mut App) -> bool

Source§

fn close_modal(&mut self, cx: &mut App)

Source§

fn close_all_modals(&mut self, cx: &mut App)

Source§

fn push_notification(&mut self, note: impl Into<Notification>, cx: &mut App)

Source§

fn remove_notification<T: Sized + 'static>(&mut self, cx: &mut App)

Source§

fn clear_notifications(&mut self, cx: &mut App)

Source§

fn notifications(&mut self, cx: &mut App) -> Rc<Vec<Entity<Notification>>>

Source§

fn has_focused_input(&mut self, cx: &mut App) -> bool

Source§

fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>

Implementors§