pub struct TextSurfaces { /* private fields */ }Expand description
A cloneable view of one tree’s registered text surfaces.
Taken once, with BuildContext::text_surfaces, and held by whatever needs
to ask the question later — a view-model refreshed from a frame tick has no
&WidgetTree to consult, which is precisely when it needs the answer.
Implementations§
Source§impl TextSurfaces
impl TextSurfaces
Sourcepub fn focused(&self) -> Option<Rc<dyn TextSurface>>
pub fn focused(&self) -> Option<Rc<dyn TextSurface>>
The text-editing widget that currently holds the keyboard focus.
None when focus is elsewhere — or nowhere — which is exactly what a
host needs in order to know that a text chord is safe to route itself.
Sourcepub fn focused_is_text_surface(&self) -> bool
pub fn focused_is_text_surface(&self) -> bool
Is the keyboard focus inside a widget that edits text? The cheap half of
focused, for a host that only needs to decide whether
to step aside.
Sourcepub fn focus_signal(&self) -> Signal<Option<WidgetId>>
pub fn focus_signal(&self) -> Signal<Option<WidgetId>>
The signal to react to. A host mirroring “can undo” into a menu row re-reads when focus moves.
Trait Implementations§
Source§impl Clone for TextSurfaces
impl Clone for TextSurfaces
Source§fn clone(&self) -> TextSurfaces
fn clone(&self) -> TextSurfaces
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TextSurfaces
impl !Send for TextSurfaces
impl !Sync for TextSurfaces
impl !UnwindSafe for TextSurfaces
impl Freeze for TextSurfaces
impl Unpin for TextSurfaces
impl UnsafeUnpin for TextSurfaces
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