Struct egui::memory::Areas

source ·
pub struct Areas {
    areas: IdMap<State>,
    order: Vec<LayerId>,
    visible_last_frame: HashSet<LayerId>,
    visible_current_frame: HashSet<LayerId>,
    wants_to_be_on_top: HashSet<LayerId>,
}
Expand description

Keeps track of Areas, which are free-floating Uis. These Areas can be in any Order.

Fields§

§areas: IdMap<State>§order: Vec<LayerId>

Back-to-front. Top is last.

§visible_last_frame: HashSet<LayerId>§visible_current_frame: HashSet<LayerId>§wants_to_be_on_top: HashSet<LayerId>

When an area want to be on top, it is put in here. At the end of the frame, this is used to reorder the layers. This means if several layers want to be on top, they will keep their relative order. So if you close three windows and then reopen them all in one frame, they will all be sent to the top, but keep their previous internal order.

Implementations§

source§

impl Areas

source

pub(crate) fn count(&self) -> usize

source

pub(crate) fn get(&self, id: Id) -> Option<&State>

source

pub(crate) fn order(&self) -> &[LayerId]

Back-to-front. Top is last.

source

pub(crate) fn set_state(&mut self, layer_id: LayerId, state: State)

source

pub fn layer_id_at( &self, pos: Pos2, resize_interact_radius_side: f32 ) -> Option<LayerId>

Top-most layer at the given position.

source

pub fn visible_last_frame(&self, layer_id: &LayerId) -> bool

source

pub fn is_visible(&self, layer_id: &LayerId) -> bool

source

pub fn visible_layer_ids(&self) -> HashSet<LayerId>

source

pub(crate) fn visible_windows(&self) -> Vec<&State>

source

pub fn move_to_top(&mut self, layer_id: LayerId)

source

pub(crate) fn end_frame(&mut self)

Trait Implementations§

source§

impl Clone for Areas

source§

fn clone(&self) -> Areas

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Areas

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Areas

source§

fn default() -> Areas

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Areas

§

impl Send for Areas

§

impl Sync for Areas

§

impl Unpin for Areas

§

impl UnwindSafe for Areas

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,