pub struct MeasureCtx<'a> {
pub theme: &'a Theme,
pub text: &'a mut TextEngine,
}Expand description
What a widget may consult while measuring itself.
The theme and the fonts, and deliberately nothing else. No bounds, because a widget being asked how big it wants to be must not answer with how big it currently is; no state, because a hovered button is not a wider button; no clock, because a size that changed every frame would be a layout that never settled.
Fields§
§theme: &'a ThemeThe active theme. Sizes come from its metrics.
text: &'a mut TextEngineFonts and the glyph cache.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MeasureCtx<'a>
impl<'a> !Send for MeasureCtx<'a>
impl<'a> !Sync for MeasureCtx<'a>
impl<'a> !UnwindSafe for MeasureCtx<'a>
impl<'a> Freeze for MeasureCtx<'a>
impl<'a> Unpin for MeasureCtx<'a>
impl<'a> UnsafeUnpin for MeasureCtx<'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