pub(crate) struct FrameState {
    pub(crate) used_ids: IdMap<Rect>,
    pub(crate) available_rect: Rect,
    pub(crate) unused_rect: Rect,
    pub(crate) used_by_panels: Rect,
    pub(crate) tooltip_state: Option<TooltipFrameState>,
    pub(crate) scroll_target: [Option<(Rangef, Option<Align>)>; 2],
    pub(crate) highlight_this_frame: HashSet<Id, BuildIdHasher>,
    pub(crate) highlight_next_frame: HashSet<Id, BuildIdHasher>,
    pub(crate) has_debug_viewed_this_frame: bool,
}
Expand description

State that is collected during a frame and then cleared. Short-term (single frame) memory.

Fields§

§used_ids: IdMap<Rect>

All Ids that were used this frame.

§available_rect: Rect

Starts off as the screen_rect, shrinks as panels are added. The CentralPanel does not change this. This is the area available to Window’s.

§unused_rect: Rect

Starts off as the screen_rect, shrinks as panels are added. The CentralPanel retracts from this.

§used_by_panels: Rect

How much space is used by panels.

§tooltip_state: Option<TooltipFrameState>

If a tooltip has been shown this frame, where was it? This is used to prevent multiple tooltips to cover each other. Initialized to None at the start of each frame.

§scroll_target: [Option<(Rangef, Option<Align>)>; 2]

horizontal, vertical

§highlight_this_frame: HashSet<Id, BuildIdHasher>

Highlight these widgets this next frame. Read from this.

§highlight_next_frame: HashSet<Id, BuildIdHasher>

Highlight these widgets the next frame. Write to this.

§has_debug_viewed_this_frame: bool

Implementations§

source§

impl FrameState

source

pub(crate) fn begin_frame(&mut self, input: &InputState)

source

pub(crate) fn available_rect(&self) -> Rect

How much space is still available after panels has been added. This is the “background” area, what egui doesn’t cover with panels (but may cover with windows). This is also the area to which windows are constrained.

source

pub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

source

pub(crate) fn allocate_right_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

source

pub(crate) fn allocate_top_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

source

pub(crate) fn allocate_bottom_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

source

pub(crate) fn allocate_central_panel(&mut self, panel_rect: Rect)

Trait Implementations§

source§

impl Clone for FrameState

source§

fn clone(&self) -> FrameState

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 Default for FrameState

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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 T
where 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 T
where T: 'static + Any + Clone + for<'a> Send + Sync,