pub struct FocusScopeState { /* private fields */ }Expand description
Shared retained focus history for a FocusScope.
Presentation policies call Self::request_restore when a previously
hidden pane or route becomes visible. The associated scope performs the
focus change on its next runtime wake without rebuilding its child subtree,
unless focus is by then on a widget outside the scope.
Implementations§
Source§impl FocusScopeState
impl FocusScopeState
pub fn new() -> Self
Sourcepub fn last_focused(&self) -> Option<WidgetId>
pub fn last_focused(&self) -> Option<WidgetId>
The widget in the scope that had focus last, which may since have moved elsewhere. Commands for “the editor you were using”, such as a toolbar’s, go to it.
Sourcepub fn last_focused_observable(
&self,
) -> impl Observable<Option<WidgetId>> + Clone + Send + Sync + 'static
pub fn last_focused_observable( &self, ) -> impl Observable<Option<WidgetId>> + Clone + Send + Sync + 'static
Self::last_focused as a value to observe, so a widget showing it
follows focus into the scope.
pub fn request_restore(&self) -> bool
pub fn clear(&self)
Trait Implementations§
Source§impl Clone for FocusScopeState
impl Clone for FocusScopeState
Source§impl Debug for FocusScopeState
impl Debug for FocusScopeState
Auto Trait Implementations§
impl Freeze for FocusScopeState
impl RefUnwindSafe for FocusScopeState
impl Send for FocusScopeState
impl Sync for FocusScopeState
impl Unpin for FocusScopeState
impl UnsafeUnpin for FocusScopeState
impl UnwindSafe for FocusScopeState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more