pub struct VisualView<S: Spec> { /* private fields */ }Expand description
Read-only per-window truth of this frame, built at the start of the compose phase (design §5.2, read path a).
Owned, not borrowed: the compose phase mutates the input engine
(registrations) while hooks hold the view, so the engine views cannot
be lent out; the copied state is exactly what the engines reported at
phase start, which is the same-tick truth the design asks the view to
be. Clicks are the last evaluated frame’s (a release is evaluated by
the EndFrame of the compose that saw it and read back from the next
compose on — one frame of latency, like every retained-registration
immediate-mode UI).
Implementations§
Source§impl<S: Spec> VisualView<S>
impl<S: Spec> VisualView<S>
Sourcepub fn is_hovered(&self, id: &WidgetId) -> bool
pub fn is_hovered(&self, id: &WidgetId) -> bool
id is under the pointer.
Sourcepub fn is_pressed(&self, id: &WidgetId) -> bool
pub fn is_pressed(&self, id: &WidgetId) -> bool
id is being pressed.
Sourcepub fn is_focused(&self, id: &WidgetId) -> bool
pub fn is_focused(&self, id: &WidgetId) -> bool
id has keyboard focus.
Sourcepub fn clicked(&self, id: &WidgetId) -> bool
pub fn clicked(&self, id: &WidgetId) -> bool
id was clicked in the last evaluated frame (single, double or
triple — see VisualView::click_count).
Sourcepub fn click_count(&self, id: &WidgetId) -> u8
pub fn click_count(&self, id: &WidgetId) -> u8
The click count id was last clicked with (0 = not clicked,
1 single, 2 double, 3 triple).
Sourcepub fn clicks(&self) -> &[(WidgetId, u8)]
pub fn clicks(&self) -> &[(WidgetId, u8)]
Every widget clicked in the last evaluated frame, with counts.
Sourcepub fn overlay_open(&self, id: S::Overlay) -> bool
pub fn overlay_open(&self, id: S::Overlay) -> bool
This overlay is open in the window.
Sourcepub fn open_overlays(&self) -> &[S::Overlay]
pub fn open_overlays(&self) -> &[S::Overlay]
Every open overlay of the window, bottom to top.