Struct druid::ViewContext
source · pub struct ViewContext {
pub window_origin: Point,
pub last_mouse_position: Option<Point>,
pub clip: Rect,
}
Expand description
Information about the widget’s surroundings.
The global origin is also saved in the widget state.
When the ViewContext
of a widget changes it receives a ViewContextChanged
event.
Fields§
§window_origin: Point
The origin of this widget relative to the window.
This is written from the perspective of the Widget and not the Pod. For the Pod this is its parent’s window origin.
last_mouse_position: Option<Point>
The last position the cursor was at, relative to the widget.
clip: Rect
The visible area, this widget is contained in, relative to the widget.
The area may be larger than the widget’s paint_rect
.
Trait Implementations§
source§impl Clone for ViewContext
impl Clone for ViewContext
source§fn clone(&self) -> ViewContext
fn clone(&self) -> ViewContext
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 moresource§impl Debug for ViewContext
impl Debug for ViewContext
impl Copy for ViewContext
Auto Trait Implementations§
impl RefUnwindSafe for ViewContext
impl Send for ViewContext
impl Sync for ViewContext
impl Unpin for ViewContext
impl UnwindSafe for ViewContext
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.