Struct zng::focus::FocusInfoTree
source · pub struct FocusInfoTree { /* private fields */ }
Expand description
A WidgetInfoTree
wrapper for querying focus info out of the widget tree.
Implementations§
source§impl FocusInfoTree
impl FocusInfoTree
sourcepub fn new(
tree: WidgetInfoTree,
focus_disabled_widgets: bool,
focus_hidden_widgets: bool,
) -> FocusInfoTree
pub fn new( tree: WidgetInfoTree, focus_disabled_widgets: bool, focus_hidden_widgets: bool, ) -> FocusInfoTree
Wrap a widget_info
reference to enable focus info querying.
See the FOCUS.focus_disabled_widgets
and FOCUS.focus_hidden_widgets
config for more details on the parameters.
sourcepub fn tree(&self) -> &WidgetInfoTree
pub fn tree(&self) -> &WidgetInfoTree
Full widget info.
sourcepub fn focus_disabled_widgets(&self) -> bool
pub fn focus_disabled_widgets(&self) -> bool
If DISABLED
widgets are focusable in this tree.
See the FOCUS.focus_disabled_widgets
config for more details.
If Hidden
widgets are focusable in this tree.
See the FOCUS.focus_hidden_widgets
config for more details.
sourcepub fn root(&self) -> WidgetFocusInfo
pub fn root(&self) -> WidgetFocusInfo
Reference to the root widget in the tree.
The root is usually a focusable focus scope but it may not be. This
is the only method that returns a WidgetFocusInfo
that may not be focusable.
sourcepub fn focusable_root(&self) -> Option<WidgetFocusInfo>
pub fn focusable_root(&self) -> Option<WidgetFocusInfo>
Reference the focusable widget closest to the window root.
When the window root is not focusable, but a descendant widget is, this method returns the focusable closest to the root counting previous siblings then parents.
sourcepub fn get(&self, widget_id: impl Into<WidgetId>) -> Option<WidgetFocusInfo>
pub fn get(&self, widget_id: impl Into<WidgetId>) -> Option<WidgetFocusInfo>
Reference to the widget in the tree, if it is present and is focusable.
sourcepub fn get_or_parent(&self, path: &WidgetPath) -> Option<WidgetFocusInfo>
pub fn get_or_parent(&self, path: &WidgetPath) -> Option<WidgetFocusInfo>
Reference to the first focusable widget or parent in the tree.
Trait Implementations§
source§impl Clone for FocusInfoTree
impl Clone for FocusInfoTree
source§fn clone(&self) -> FocusInfoTree
fn clone(&self) -> FocusInfoTree
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for FocusInfoTree
impl !RefUnwindSafe for FocusInfoTree
impl Send for FocusInfoTree
impl Sync for FocusInfoTree
impl Unpin for FocusInfoTree
impl !UnwindSafe for FocusInfoTree
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more