pub struct LaidOutWidget<Msg: Clone> {
pub rect: Rect,
pub flat_idx: usize,
pub id: Option<WidgetId>,
pub paint_rect: Rect,
pub handlers: WidgetHandlers<Msg>,
pub keyboard_focusable: bool,
pub cursor: CursorShape,
pub tooltip: Option<String>,
pub accessible_label: Option<String>,
pub is_live_region: bool,
}Expand description
Result of laying out one interactive widget — i.e. a widget that should
receive pointer / touch hit-testing. Captures both the hit rect (where
input lands) and the paint rect (the bounding box of everything the
widget actually paints, including hover circles, focus rings, shadows…).
The paint rect is used by the partial-redraw path to know how much of the
canvas must be invalidated when a widget transitions in/out of a given
state — it is always >= rect.
handlers carries the snapshot of the widget’s callbacks/values at layout
time so input dispatch is O(1) instead of re-walking the super::Element tree.
keyboard_focusable snapshots whether the widget should participate in the
Tab / Shift+Tab cycle. Most interactive widgets are also keyboard-focusable
(Button, TextEdit, Slider, …) but window-decoration chrome
(WindowButton) is interactive without taking keyboard focus by default —
matching the convention of macOS / GNOME / Windows title bars.
Fields§
§rect: Rect§flat_idx: usize§id: Option<WidgetId>§paint_rect: Rect§handlers: WidgetHandlers<Msg>§keyboard_focusable: bool§cursor: CursorShapeCursor shape this widget wants to show on hover. Snapshotted
from super::Element::cursor_shape at layout time so the input
dispatch can pick the right shape without re-walking the
element tree.
tooltip: Option<String>§accessible_label: Option<String>Visible text of the widget, captured for the accessibility
tree. None for non-textual widgets (icons, dividers).
is_live_region: boolTrait Implementations§
Auto Trait Implementations§
impl<Msg> Freeze for LaidOutWidget<Msg>where
Msg: Freeze,
impl<Msg> !RefUnwindSafe for LaidOutWidget<Msg>
impl<Msg> !Send for LaidOutWidget<Msg>
impl<Msg> !Sync for LaidOutWidget<Msg>
impl<Msg> Unpin for LaidOutWidget<Msg>where
Msg: Unpin,
impl<Msg> !UnwindSafe for LaidOutWidget<Msg>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more