pub struct Layout {
pub sections: BTreeMap<String, Remembered>,
pub empty: f32,
}Expand description
What a stack remembers, by section key: kept in egui’s persisted
memory under the stack’s name, and readable and writable whole
(Layout::load, Layout::store) for an application that keeps
it with its own layout. egui_stack’s own
([egui_stack::sections::Layout]) converts to and from it.
Fields§
§sections: BTreeMap<String, Remembered>§empty: f32The empty room kept under the last section, in points.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn load(ctx: &Context, name: &str) -> Option<Layout>
pub fn load(ctx: &Context, name: &str) -> Option<Layout>
The layout a stack named name remembers, if any.
Sourcepub fn store(&self, ctx: &Context, name: &str)
pub fn store(&self, ctx: &Context, name: &str)
Makes it the layout of the stack named name (shown so from the
next pass).
Sourcepub fn is_open(&self, key: &str) -> Option<bool>
pub fn is_open(&self, key: &str) -> Option<bool>
Whether a section is open, if the layout knows it.
Sourcepub fn set_height(&mut self, key: &str, height: Option<f32>)
pub fn set_height(&mut self, key: &str, height: Option<f32>)
Sets a section’s height by hand, as a drag would, or gives it back to the list. It opens as the stack first shows it when the layout does not know it yet.
Sourcepub fn reset_heights(&mut self)
pub fn reset_heights(&mut self)
Drops every height set by hand and the empty room (a boundary’s double click): the sections share the panel again.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
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>,
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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,
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