pub struct PaintCx<'a> { /* private fields */ }Expand description
What a widget gets while it paints.
Implementations§
Source§impl PaintCx<'_>
impl PaintCx<'_>
Sourcepub fn rect(&self) -> Rect
pub fn rect(&self) -> Rect
Where the widget is, in physical pixels from the window’s top-left corner.
Sourcepub fn content_rect(&self) -> Rect
pub fn content_rect(&self) -> Rect
The widget’s rectangle inside its padding.
Sourcepub fn content_size(&self) -> Size
pub fn content_size(&self) -> Size
The size of what the widget’s children cover, for scroll bars.
Sourcepub fn is_hovered(&self) -> bool
pub fn is_hovered(&self) -> bool
Whether the pointer is over the widget or one of its children.
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Whether the widget has keyboard focus.
Sourcepub fn is_pressed(&self) -> bool
pub fn is_pressed(&self) -> bool
Whether the widget handled a pointer press that has not been released yet.
Sourcepub fn is_hover_target(&self) -> bool
pub fn is_hover_target(&self) -> bool
Whether the pointer is over the widget itself, not one of its children.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PaintCx<'a>
impl<'a> !Send for PaintCx<'a>
impl<'a> !Sync for PaintCx<'a>
impl<'a> !UnwindSafe for PaintCx<'a>
impl<'a> Freeze for PaintCx<'a>
impl<'a> Unpin for PaintCx<'a>
impl<'a> UnsafeUnpin 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
Mutably borrows from an owned value. Read more