pub struct WidgetRects { /* private fields */ }Expand description
Stores the WidgetRects of all widgets generated during a single egui update/frame.
All crate::Uis have a WidgetRect. It is created in crate::Ui::new with Rect::NOTHING
and updated with the correct Rect when the crate::Ui is dropped.
Implementations§
source§impl WidgetRects
impl WidgetRects
sourcepub fn layer_ids(&self) -> impl ExactSizeIterator<Item = LayerId> + '_
pub fn layer_ids(&self) -> impl ExactSizeIterator<Item = LayerId> + '_
All known layers with widgets.
pub fn layers(&self) -> impl Iterator<Item = (&LayerId, &[WidgetRect])> + '_
pub fn get(&self, id: Id) -> Option<&WidgetRect>
sourcepub fn order(&self, id: Id) -> Option<(LayerId, usize)>
pub fn order(&self, id: Id) -> Option<(LayerId, usize)>
In which layer, and in which order in that layer?
pub fn contains(&self, id: Id) -> bool
sourcepub fn get_layer(
&self,
layer_id: LayerId,
) -> impl Iterator<Item = &WidgetRect> + '_
pub fn get_layer( &self, layer_id: LayerId, ) -> impl Iterator<Item = &WidgetRect> + '_
All widgets in this layer, sorted back-to-front.
sourcepub fn insert(&mut self, layer_id: LayerId, widget_rect: WidgetRect)
pub fn insert(&mut self, layer_id: LayerId, widget_rect: WidgetRect)
Insert the given widget rect in the given layer.
pub fn set_info(&mut self, id: Id, info: WidgetInfo)
pub fn info(&self, id: Id) -> Option<&WidgetInfo>
Trait Implementations§
source§impl Clone for WidgetRects
impl Clone for WidgetRects
source§fn clone(&self) -> WidgetRects
fn clone(&self) -> WidgetRects
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Default for WidgetRects
impl Default for WidgetRects
source§fn default() -> WidgetRects
fn default() -> WidgetRects
Returns the “default value” for a type. Read more
source§impl PartialEq for WidgetRects
impl PartialEq for WidgetRects
Auto Trait Implementations§
impl Freeze for WidgetRects
impl RefUnwindSafe for WidgetRects
impl Send for WidgetRects
impl Sync for WidgetRects
impl Unpin for WidgetRects
impl UnwindSafe for WidgetRects
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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