pub struct PaintCx<'a> {
pub window_state: &'a mut WindowState,
pub gpu_resources: Option<GpuResources>,
pub window: Arc<dyn Window>,
/* private fields */
}Fields§
§window_state: &'a mut WindowState§gpu_resources: Option<GpuResources>§window: Arc<dyn Window>Implementations§
Source§impl PaintCx<'_>
impl PaintCx<'_>
pub fn save(&mut self)
pub fn restore(&mut self)
Sourcepub fn is_drag_paint(&self, id: ViewId) -> bool
pub fn is_drag_paint(&self, id: ViewId) -> bool
Allows a View to determine if it is being called in order to
paint a draggable image of itself during a drag (likely
draggable() was called on the View or ViewId) as opposed
to a normal paint in order to alter the way it renders itself.
Sourcepub fn paint_children(&mut self, id: ViewId)
pub fn paint_children(&mut self, id: ViewId)
Paint the children of this view using simplified stacking semantics.
In the simplified stacking model:
- Every view is implicitly a stacking context
- z-index only competes with siblings
- Children are always bounded within their parent (no “escaping”)
Sourcepub fn paint_view(&mut self, id: ViewId)
pub fn paint_view(&mut self, id: ViewId)
The entry point for painting a view. You shouldn’t need to implement this yourself. Instead, implement [View::paint].
It handles the internal work before and after painting [View::paint] implementations.
It is responsible for
- managing hidden status
- clipping
- painting computed styles like background color, border, font-styles, and z-index and handling painting requirements of drag and drop
Sourcepub fn paint_pending_drag(&mut self)
pub fn paint_pending_drag(&mut self)
Paint the drag overlay after the main tree has been painted. This ensures the dragged view always appears on top of all other content.
Sourcepub fn paint_overlays(&mut self, root_id: ViewId)
pub fn paint_overlays(&mut self, root_id: ViewId)
Paint all registered overlays for the given root view.
Overlays are painted at the root level, above all regular content but below drag overlays. They are sorted by z-index (lower z-index painted first).
The overlay views are skipped during normal tree traversal (in collect_stacking_context_items)
and painted here at root level so they appear above all other content.
Sourcepub fn clear_clip(&mut self)
pub fn clear_clip(&mut self)
Remove clipping so the entire window can be rendered to.
pub fn offset(&mut self, offset: (f64, f64))
pub fn transform(&mut self, id: ViewId) -> Size
pub fn is_focused(&self, id: ViewId) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PaintCx<'a>
impl<'a> !RefUnwindSafe for PaintCx<'a>
impl<'a> !Send for PaintCx<'a>
impl<'a> !Sync for PaintCx<'a>
impl<'a> Unpin for PaintCx<'a>
impl<'a> !UnwindSafe for PaintCx<'a>
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> 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