Struct egui::containers::frame::Prepared
source · pub struct Prepared {
pub frame: Frame,
where_to_put_background: ShapeIdx,
pub content_ui: Ui,
}
Fields§
§frame: Frame
The frame that was prepared.
The margin has already been read and used, but the rest of the fields may be modified.
where_to_put_background: ShapeIdx
This is where we will insert the frame shape so it ends up behind the content.
content_ui: Ui
Add your widgets to this UI so it ends up within the frame.
Implementations§
source§impl Prepared
impl Prepared
fn content_with_margin(&self) -> Rect
sourcepub fn allocate_space(&self, ui: &mut Ui) -> Response
pub fn allocate_space(&self, ui: &mut Ui) -> Response
Allocate the space that was used by Self::content_ui
.
This MUST be called, or the parent ui will not know how much space this widget used.
This can be called before or after Self::paint
.
sourcepub fn paint(&self, ui: &Ui)
pub fn paint(&self, ui: &Ui)
Paint the frame.
This can be called before or after Self::allocate_space
.
sourcepub fn end(self, ui: &mut Ui) -> Response
pub fn end(self, ui: &mut Ui) -> Response
Convenience for calling Self::allocate_space
and Self::paint
.
Auto Trait Implementations§
impl Freeze for Prepared
impl !RefUnwindSafe for Prepared
impl Send for Prepared
impl Sync for Prepared
impl Unpin for Prepared
impl !UnwindSafe for Prepared
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