pub struct OverlayCx<'a, S: Spec> {
pub window: WindowId,
pub id: S::Overlay,
pub body: Rect,
pub rect: Rect,
pub dpr: f64,
pub tokens: &'a Tokens,
pub render: &'a mut dyn RenderContext,
pub widgets: Widgets<'a>,
pub view: &'a VisualView<S>,
pub time: FrameTime,
pub out: &'a mut HookOps<S>,
}Expand description
One open overlay’s body hook context (design §6.3); same reach as
PanelCx, plus the overlay identity and the body rect the kernel’s
frame leaves.
Fields§
§window: WindowIdThe window being composed.
id: S::OverlayThe overlay being drawn.
body: RectBody rect, window-local logical pixels (inside the kernel-drawn frame).
rect: RectContent rect the body may register widgets into (equals body).
dpr: f64Device pixel ratio of the window.
tokens: &'a TokensActive theme tokens.
render: &'a mut dyn RenderContextThe paint target.
widgets: Widgets<'a>Widget registration face (the overlay’s own layer).
view: &'a VisualView<S>This frame’s input truth of the window.
time: FrameTimeFrame clock.
out: &'a mut HookOps<S>Declared effects out.
Trait Implementations§
Source§impl<'a, S: Spec> ContentCx<'a> for OverlayCx<'a, S>
impl<'a, S: Spec> ContentCx<'a> for OverlayCx<'a, S>
Source§fn frame_now_ms(&self) -> f64
fn frame_now_ms(&self) -> f64
The frame clock in milliseconds, unrounded: the stamp scroll containers share
within one frame.
Source§fn request_frame(&mut self)
fn request_frame(&mut self)
Ask for another frame (an animation or a scroll is still moving).
Source§fn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Painting into an overlay (a modal makes the page’s scroll containers inert to keys).
Source§fn ime_area(&mut self, rect: Rect)
fn ime_area(&mut self, rect: Rect)
Report the focused field’s caret rect so the OS IME window opens there.
Source§fn time_ms(&self) -> u64
fn time_ms(&self) -> u64
Host clock in whole milliseconds. Same unit as
TextFieldStore::cursor_visible.Source§fn with_paint<R>(
&mut self,
f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<S>, &Tokens) -> R,
) -> R
fn with_paint<R>( &mut self, f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<S>, &Tokens) -> R, ) -> R
Run
f against this frame’s paint target and registration face.Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for OverlayCx<'a, S>
impl<'a, S> !Send for OverlayCx<'a, S>
impl<'a, S> !Sync for OverlayCx<'a, S>
impl<'a, S> !UnwindSafe for OverlayCx<'a, S>
impl<'a, S> Forget for OverlayCx<'a, S>
impl<'a, S> Freeze for OverlayCx<'a, S>
impl<'a, S> Move for OverlayCx<'a, S>
impl<'a, S> Unpin for OverlayCx<'a, S>
impl<'a, S> UnsafeUnpin for OverlayCx<'a, S>where
<S as Spec>::Overlay: UnsafeUnpin,
&'a VisualView<S>: UnsafeUnpin,
&'a mut HookOps<S>: UnsafeUnpin,
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