pub struct PaintCtx<'a> {
pub theme: &'a Theme,
pub text: &'a mut TextEngine,
pub bounds: Rect,
pub state: VisualState,
pub now_ms: u64,
}Expand description
What a widget needs in order to draw itself.
Mutable, because PaintCtx::text is: measuring a string is what fills the
glyph cache, so a widget that measures and then draws rasterises each glyph
once rather than twice. The widget itself is still &self.
Fields§
§theme: &'a ThemeThe active theme. Widgets name roles, never colours.
text: &'a mut TextEngineFonts and the glyph cache.
bounds: RectAbsolute bounds of this widget, in surface pixels.
state: VisualStateHover, press, focus and enabled state, tracked by the tree.
now_ms: u64Milliseconds from an arbitrary epoch, as last given to crate::Ui::tick.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PaintCtx<'a>
impl<'a> !Send for PaintCtx<'a>
impl<'a> !Sync for PaintCtx<'a>
impl<'a> !UnwindSafe for PaintCtx<'a>
impl<'a> Freeze for PaintCtx<'a>
impl<'a> Unpin for PaintCtx<'a>
impl<'a> UnsafeUnpin for PaintCtx<'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