pub struct SurfaceScaffold { /* private fields */ }Expand description
A full-viewport scaffold that positions a panel against a screen edge, optionally dims the area behind it, and dismisses on a press outside the panel. It is the reusable body of a drawer/modal: a shell mounts it as the root of a full-screen layer-shell surface, and a windowed app can mount it in-tree as an in-window portal — both get the same positioning and dismiss behaviour.
Like other full-surface roots it (re)computes its own layout on WindowResized; the runner synthesizes
an initial one on resume, so the scaffold is laid out before its first frame.
Implementations§
Source§impl SurfaceScaffold
impl SurfaceScaffold
pub fn new( placement: &SurfacePlacement, content: Box<dyn LayoutItem>, dismiss: Option<Rc<dyn Fn()>>, ) -> Result<Self, LayoutError>
pub fn animate_in(self) -> Self
Sourcepub fn animate(self, transition: SurfaceTransition) -> Self
pub fn animate(self, transition: SurfaceTransition) -> Self
Drives the scaffold from a transition the caller owns, so it can also send the surface back out — see
SurfaceTransition::leave.
Trait Implementations§
Source§impl Component for SurfaceScaffold
impl Component for SurfaceScaffold
fn view(&self) -> RenderNode
fn on_event(&mut self, event: &Event) -> EventResult
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Human-readable widget type name for the devtools tree inspector.
Source§impl LayoutItem for SurfaceScaffold
impl LayoutItem for SurfaceScaffold
fn layout_node(&self) -> NodeId
Auto Trait Implementations§
impl !RefUnwindSafe for SurfaceScaffold
impl !Send for SurfaceScaffold
impl !Sync for SurfaceScaffold
impl !UnwindSafe for SurfaceScaffold
impl Freeze for SurfaceScaffold
impl Unpin for SurfaceScaffold
impl UnsafeUnpin for SurfaceScaffold
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