Struct druid::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
Trait Implementations§
source§impl Clone for WidgetState
impl Clone for WidgetState
source§fn clone(&self) -> WidgetState
fn clone(&self) -> WidgetState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for WidgetState
impl !Send for WidgetState
impl !Sync for WidgetState
impl Unpin for WidgetState
impl UnwindSafe for WidgetState
Blanket Implementations§
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>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.