Struct masonry::widget::WidgetState
source · pub struct WidgetState { /* private fields */ }
Expand description
Generic state for all widgets in the hierarchy.
This struct contains the widget’s layout rect, flags indicating when the widget is active or focused, and other state necessary for the widget to participate in event flow.
It is provided to paint
calls as a non-mutable reference,
largely so a widget can know its size, also because active
and focus state can affect the widget’s appearance. Other than
that, widgets will generally not interact with it directly,
but it is an important part of the WidgetPod
struct.
Implementations§
source§impl WidgetState
impl WidgetState
sourcepub fn paint_rect(&self) -> Rect
pub fn paint_rect(&self) -> Rect
The paint region for this widget.
For more information, see WidgetPod::paint_rect
.
sourcepub fn layout_rect(&self) -> Rect
pub fn layout_rect(&self) -> Rect
The rectangle used when calculating layout with other widgets
For more information, see WidgetPod::layout_rect
.
sourcepub fn window_layout_rect(&self) -> Rect
pub fn window_layout_rect(&self) -> Rect
The layout_rect
in window coordinates.
This might not map to a visible area of the screen, eg if the widget is scrolled away.
Trait Implementations§
source§impl Clone for WidgetState
impl Clone for WidgetState
source§fn clone(&self) -> WidgetState
fn clone(&self) -> WidgetState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more