pub struct AreaState {
pub pivot_pos: Option<Pos2>,
pub pivot: Align2,
pub size: Option<Vec2>,
pub interactable: bool,
pub last_became_visible_at: Option<f64>,
}
Expand description
State of an Area
that is persisted between frames.
Areas back crate::Window
s and other floating containers,
like tooltips and the popups of crate::ComboBox
.
Fields§
§pivot_pos: Option<Pos2>
Last known position of the pivot.
pivot: Align2
The anchor point of the area, i.e. where on the area the Self::pivot_pos
refers to.
size: Option<Vec2>
Last known size.
Area size is intentionally NOT persisted between sessions,
so that a bad tooltip or menu size won’t be remembered forever.
A resizable crate::Window
remembers the size the user picked using
the state in the crate::Resize
container.
interactable: bool
If false, clicks goes straight through to what is behind us. Useful for tooltips etc.
last_became_visible_at: Option<f64>
At what time was this area first shown?
Used to fade in the area.
Implementations§
Source§impl AreaState
impl AreaState
Sourcepub fn left_top_pos(&self) -> Pos2
pub fn left_top_pos(&self) -> Pos2
The left top positions of the area.
Sourcepub fn set_left_top_pos(&mut self, pos: Pos2)
pub fn set_left_top_pos(&mut self, pos: Pos2)
Move the left top positions of the area.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AreaState
impl<'de> Deserialize<'de> for AreaState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for AreaState
Auto Trait Implementations§
impl Freeze for AreaState
impl RefUnwindSafe for AreaState
impl Send for AreaState
impl Sync for AreaState
impl Unpin for AreaState
impl UnwindSafe for AreaState
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