pub struct AppState {
pub taffy: Taffy,
/* private fields */
}
Expand description
Encapsulates and owns the global state of the application,
including the ViewState
of each view.
Fields§
§taffy: Taffy
Implementations§
source§impl AppState
impl AppState
pub fn new() -> Self
pub fn view_state(&mut self, id: Id) -> &mut ViewState
sourcepub fn remove_view(&mut self, view: &mut dyn View)
pub fn remove_view(&mut self, view: &mut dyn View)
This removes a view from the app state.
Is this view, or any parent view, marked as hidden
pub fn is_hovered(&self, id: &Id) -> bool
pub fn is_disabled(&self, id: &Id) -> bool
pub fn is_focused(&self, id: &Id) -> bool
pub fn is_active(&self, id: &Id) -> bool
pub fn is_clicking(&self, id: &Id) -> bool
pub fn is_dragging(&self) -> bool
pub fn set_root_size(&mut self, size: Size)
pub fn get_builtin_style(&mut self, id: Id) -> BuiltinStyle<'_>
pub fn compute_layout(&mut self)
sourcepub fn request_style_recursive(&mut self, id: Id)
pub fn request_style_recursive(&mut self, id: Id)
Requests style for a view and all direct and indirect children.
sourcepub fn request_all(&mut self, id: Id)
pub fn request_all(&mut self, id: Id)
Request that this the id
view be styled, laid out and painted again.
This will recursively request this for all parents.
sourcepub fn schedule_style(&mut self, id: Id)
pub fn schedule_style(&mut self, id: Id)
Requests that the style pass will run for id
on the next frame, and ensures new frame is
scheduled to happen.
sourcepub fn schedule_layout(&mut self, id: Id)
pub fn schedule_layout(&mut self, id: Id)
Requests that the layout pass will run for id
on the next frame, and ensures new frame is
scheduled to happen.
sourcepub fn schedule_paint(&mut self, id: Id)
pub fn schedule_paint(&mut self, id: Id)
Requests that the paint pass will run for id
on the next frame, and ensures new frame is
scheduled to happen.
pub fn request_style(&mut self, id: Id)
pub fn request_layout(&mut self, id: Id)
sourcepub fn request_compute_layout_recursive(&mut self, _id: Id)
pub fn request_compute_layout_recursive(&mut self, _id: Id)
Requests that compute_layout
will run for _id
and all direct and indirect children.
pub fn request_paint(&mut self, _id: Id)
sourcepub fn get_content_rect(&mut self, id: Id) -> Rect
pub fn get_content_rect(&mut self, id: Id) -> Rect
Returns the layout rect excluding borders, padding and position. This is relative to the view.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !Send for AppState
impl !Sync for AppState
impl Unpin for AppState
impl !UnwindSafe for AppState
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
§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>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.