pub struct PodState<T, V: View<T> + ?Sized> { /* private fields */ }
Expand description
The state of a Pod
.
Methods from Deref<Target = ViewState>§
Sourcepub fn is_hovered(&self) -> bool
pub fn is_hovered(&self) -> bool
Get whether the view is hovered.
Sourcepub fn set_hovered(&mut self, hovered: bool)
pub fn set_hovered(&mut self, hovered: bool)
Set whether the view is hovered.
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Get whether the view is focused.
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set whether the view is focused.
Sourcepub fn set_active(&mut self, active: bool)
pub fn set_active(&mut self, active: bool)
Set whether the view is active.
Sourcepub fn has_hovered(&self) -> bool
pub fn has_hovered(&self) -> bool
Get whether the view has a hovered child.
Sourcepub fn has_focused(&self) -> bool
pub fn has_focused(&self) -> bool
Get whether the view has a focused child.
Sourcepub fn has_active(&self) -> bool
pub fn has_active(&self) -> bool
Get whether the view has an active child.
Sourcepub fn is_focusable(&self) -> bool
pub fn is_focusable(&self) -> bool
Get whether the view is focusable.
Sourcepub fn set_focusable(&mut self, focusable: bool)
pub fn set_focusable(&mut self, focusable: bool)
Set whether the view is focusable.
Sourcepub fn contains_property<T: 'static>(&self) -> bool
pub fn contains_property<T: 'static>(&self) -> bool
Check if the view has the property T
.
Sourcepub fn insert_property<T: 'static>(&mut self, item: T)
pub fn insert_property<T: 'static>(&mut self, item: T)
Insert a property into the view.
Sourcepub fn remove_property<T: 'static>(&mut self) -> Option<T>
pub fn remove_property<T: 'static>(&mut self) -> Option<T>
Remove a property from the view.
Sourcepub fn get_property<T: 'static>(&self) -> Option<&T>
pub fn get_property<T: 'static>(&self) -> Option<&T>
Get the property T
of the view.
Sourcepub fn get_property_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn get_property_mut<T: 'static>(&mut self) -> Option<&mut T>
Get the property T
of the view mutably.
Sourcepub fn property_or_insert_with<T: 'static, F: FnOnce() -> T>(
&mut self,
f: F,
) -> &mut T
pub fn property_or_insert_with<T: 'static, F: FnOnce() -> T>( &mut self, f: F, ) -> &mut T
Get the property T
of the view or insert it with a value.
Sourcepub fn property_or<T: 'static>(&mut self, item: T) -> &mut T
pub fn property_or<T: 'static>(&mut self, item: T) -> &mut T
Get the property T
of the view or insert it with a value.
Sourcepub fn property_or_default<T: 'static + Default>(&mut self) -> &mut T
pub fn property_or_default<T: 'static + Default>(&mut self) -> &mut T
Get the property T
of the view or insert it with a default value.
Sourcepub fn set_transform(&mut self, transform: Affine)
pub fn set_transform(&mut self, transform: Affine)
Set the transform of the view.
Sourcepub fn request_layout(&mut self)
pub fn request_layout(&mut self)
Request a layout of the view tree.
Sourcepub fn request_draw(&mut self)
pub fn request_draw(&mut self)
Request a draw of the view tree.
Sourcepub fn request_animate(&mut self)
pub fn request_animate(&mut self)
Request an animation frame of the view tree.
Sourcepub fn needs_layout(&self) -> bool
pub fn needs_layout(&self) -> bool
Get whether the view needs to be laid out.
Sourcepub fn needs_draw(&self) -> bool
pub fn needs_draw(&self) -> bool
Get whether the view needs to be drawn.
Sourcepub fn needs_animate(&self) -> bool
pub fn needs_animate(&self) -> bool
Get whether the view needs an animation frame.
Sourcepub fn mark_layed_out(&mut self)
pub fn mark_layed_out(&mut self)
Mark the view as laid out.
This will remove the Update::LAYOUT
flag.
Sourcepub fn mark_drawn(&mut self)
pub fn mark_drawn(&mut self)
Mark the view as drawn.
This will remove the Update::DRAW
flag.
Sourcepub fn mark_animated(&mut self)
pub fn mark_animated(&mut self)
Mark the view as animated.
This will remove the Update::ANIMATE
flag.
Sourcepub fn set_cursor(&mut self, cursor: Option<Cursor>)
pub fn set_cursor(&mut self, cursor: Option<Cursor>)
Set the cursor of the view.