WindowExt

Trait WindowExt 

Source
pub trait WindowExt: Sized {
Show 14 methods // Required methods fn open_sheet<F>(&mut self, cx: &mut App, build: F) where F: Fn(Sheet, &mut Window, &mut App) -> Sheet + 'static; fn open_sheet_at<F>(&mut self, placement: Placement, cx: &mut App, build: F) where F: Fn(Sheet, &mut Window, &mut App) -> Sheet + 'static; fn has_active_sheet(&mut self, cx: &mut App) -> bool; fn close_sheet(&mut self, cx: &mut App); fn open_dialog<F>(&mut self, cx: &mut App, build: F) where F: Fn(Dialog, &mut Window, &mut App) -> Dialog + 'static; fn has_active_dialog(&mut self, cx: &mut App) -> bool; fn close_dialog(&mut self, cx: &mut App); fn close_all_dialogs(&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 Window to add dialog, sheet .. functionality.

Required Methods§

Source

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

Opens a Sheet at right placement.

Source

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

Opens a Sheet at the given placement.

Source

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

Return true, if there is an active Sheet.

Source

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

Closes the active Sheet.

Source

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

Opens a Dialog.

Source

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

Return true, if there is an active Dialog.

Source

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

Closes the last active Dialog.

Source

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

Closes all active Dialogs.

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 WindowExt for Window

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn close_all_dialogs(&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§